Click here to Skip to main content
15,885,278 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
<ComboBox Name="PrinterSelection_ComboBox"
                   Height="43" SelectedIndex="0" Margin="435,250,450,357" Width="200"
                   SelectionChanged="PrinterSelection_ComboBox_SelectionChanged"
                   ItemsSource="{Binding PrinterList}">
                   <ComboBox.ItemTemplate>
                       <DataTemplate>
                           <WrapPanel Margin="0,5,0,5" Height="45">
                               <Image x:Name="PrinterImage" Source="{Binding ComboBoxItemImage}"
                               Height="20" Stretch="Fill"
                                HorizontalAlignment="Left" VerticalAlignment="Center"/>
                               <Label x:Name="PrinterName"  Content="{Binding ComboBoxItemName}"
                              TextBlock.TextAlignment="Center"
                               VerticalAlignment="Center"/>
                           </WrapPanel>
                       </DataTemplate>
                   </ComboBox.ItemTemplate>
               </ComboBox>


What I have tried:

<ComboBox Name="PrinterSelection_ComboBox"
                   Height="43" SelectedIndex="0" Margin="435,250,450,357" Width="200"
                   SelectionChanged="PrinterSelection_ComboBox_SelectionChanged"
                   ItemsSource="{Binding PrinterList}">
                   <ComboBox.ItemTemplate>
                       <DataTemplate>
                           <WrapPanel Margin="0,5,0,5" Height="45">
                               <Image x:Name="PrinterImage" Source="{Binding ComboBoxItemImage}"
                               Height="20" Stretch="Fill"
                                HorizontalAlignment="Left" VerticalAlignment="Center"/>
                               <Label x:Name="PrinterName"  Content="{Binding ComboBoxItemName}"
                              TextBlock.TextAlignment="Center"
                               VerticalAlignment="Center"/>
                           </WrapPanel>
                       </DataTemplate>
                   </ComboBox.ItemTemplate>
               </ComboBox>
Posted
Comments
Richard MacCutchan 21-Sep-22 10:01am    
If you have a problem with some code then please explain exactly what it is. Just dumping two copies of the same code with noe details does not help us to help you. So please use the Improve question link above, and add complete details of what is not working.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900