GrüßeWPF - Comboboxitems - Allgemeine Hintergrundbild
Ich habe eine Frage bezüglich der Combobox in WPF, lassen Sie mich die aktuelle Situation skizzieren, die ich habe:
<ComboBox IsEditable="False" Height="23" HorizontalAlignment="Left" Margin="8,112,0,0" Name="comboBox1" VerticalAlignment="Top" Width="140" Background="Transparent">
<Image Source="pack://application:,,,/Images/Style/Player/Static/Red.png" Width="122" />
<Image Source="pack://application:,,,/Images/Style/Player/Static/Blue.png" Width="122" />
<Image Source="pack://application:,,,/Images/Style/Player/Static/Teal.png" Width="122" />
<Image Source="pack://application:,,,/Images/Style/Player/Static/Purple.png" Width="122" />
<Image Source="pack://application:,,,/Images/Style/Player/Static/Yellow.png" Width="122" />
<Image Source="pack://application:,,,/Images/Style/Player/Static/Orange.png" Width="122" />
<Image Source="pack://application:,,,/Images/Style/Player/Static/Green.png" Width="122" />
<Image Source="pack://application:,,,/Images/Style/Player/Static/Pink.png" Width="122" />
</ComboBox>
Kurz gesagt ein ComboBox mit ein paar Bilder in ihm als ComboboxItem. Wie kann ich es tun, so dass ich 1 großes Hintergrundbild (die Größe der erweiterten Box aus der Combobox) für alle diese Bilder anstelle von 1 Hintergrundbild PER ComboboxItem habe. Jedes Bild in einem ComboboxItem hat einen transparenten Hintergrund, sodass das Hintergrundbild sichtbar sein sollte.
Vielen Dank für das Lesen und Ihren möglichen Rat.
Verwenden Sie den übergeordneten Rahmen anstelle des Rechtecks. Siehe meine Antwort –