Quantcast
Channel: Programming Forums
Viewing all articles
Browse latest Browse all 51036

WPF Picture and Text for each entry

$
0
0
hi,

Is it possible to add picture and the text in to WPF list box like we do on traditional List box for each entry. here I attached my Xmal file and the screen shot of the window.



Posted Image






<Window x:Class="WpfApplication1.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="MainWindow" Height="350" Width="609">
    <Grid>
        <ListBox Margin="12,12,259,12" HorizontalContentAlignment="Stretch" FontFamily="Verdana" >
            <ListBoxItem Margin=" 0,3,0,3" />
            
            <StackPanel Orientation="Horizontal" Margin=" 3" >
                <Image Source="D:\sun.jpg" Margin=" 3" Height="41" Width="46">
                    
                    
                </Image>
                <TextBlock Margin=" 5 " Padding=" 2" FontSize="13" FontWeight="Bold" Foreground="DarkTurquoise" >sample
                    
                </TextBlock>
                
            </StackPanel>
        </ListBox>
        <Button Content="Add items to List Box" Height="26" HorizontalAlignment="Left" Margin="352,197,0,0" Name="button1" VerticalAlignment="Top" Width="131" />
        <TextBox Height="45" HorizontalAlignment="Left" Margin="352,146,0,0" Name="textBox1" VerticalAlignment="Top" Width="131" />
    </Grid>
</Window>


Viewing all articles
Browse latest Browse all 51036

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>