ListBox with Image

image_pdfimage_print


   
      
<Window x:Class="Window1"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="Use ListBox" Height="300" Width="300">
    <Grid>
        <ListBox Margin="10,10,10,0" Name="ListBox1" VerticalAlignment="Top" SelectedIndex="1" VerticalContentAlignment="Center">
            <ListBoxItem>Apple</ListBoxItem>
            <ListBoxItem Name="cbiSmile">
                <StackPanel Orientation="Horizontal">
                    <Image Source="c:image.bmp" Width="15" Height="15" />
                    <Label Content="Happy!" />
                </StackPanel>
            </ListBoxItem>
            <ListBoxItem>Cherry</ListBoxItem>
        </ListBox>
    </Grid>
</Window>