Click here to Skip to main content
15,915,800 members
Home / Discussions / WPF
   

WPF

 
GeneralRe: Small question re: customized controls in WPF Pin
chaiguy13375-Sep-08 10:55
chaiguy13375-Sep-08 10:55 
AnswerRe: Small question re: customized controls in WPF Pin
Pete O'Hanlon5-Sep-08 10:07
mvePete O'Hanlon5-Sep-08 10:07 
GeneralRe: Small question re: customized controls in WPF Pin
chaiguy13375-Sep-08 10:11
chaiguy13375-Sep-08 10:11 
GeneralRe: Small question re: customized controls in WPF Pin
Insincere Dave5-Sep-08 12:49
Insincere Dave5-Sep-08 12:49 
GeneralRe: Small question re: customized controls in WPF Pin
chaiguy13375-Sep-08 20:06
chaiguy13375-Sep-08 20:06 
GeneralRe: Small question re: customized controls in WPF Pin
Pete O'Hanlon5-Sep-08 22:55
mvePete O'Hanlon5-Sep-08 22:55 
QuestionWPF - Creating Controls Dynamically on a Stack Panel Pin
Jonso4-Sep-08 15:15
Jonso4-Sep-08 15:15 
QuestionHow to enable Context menu for a listbox item. Pin
Aslesh4-Sep-08 6:22
Aslesh4-Sep-08 6:22 
<Window x:Class="HDI_WPF_ListItemTemplate_cs.Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Window1" Height="300" Width="300" Loaded="Window_Loaded">
<Grid>
<ListBox x:Name="lstItems" Width="300" MaxHeight="300" FontSize="16">
<ListBox.ItemTemplate>
<DataTemplate>
<Border BorderBrush="Blue" Margin="0,4,0,4" BorderThickness="1" CornerRadius="5">
<StackPanel Orientation="Vertical">
<StackPanel Orientation="Horizontal" Background="AntiqueWhite">
<TextBlock FontSize="16" Text="{Binding Path=FirstName}" />
<TextBlock FontSize="16" Text=" " />
<TextBlock FontSize="16" Text="{Binding Path=LastName}" />
</StackPanel>
<TextBlock FontSize="12" Text="{Binding Path=Age}" />
<TextBlock FontSize="12" Text="{Binding Path=FavoriteMovie}" />
</StackPanel>
</Border>
</DataTemplate>
</ListBox.ItemTemplate>
<ListBox.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel Orientation="Vertical" />
</ItemsPanelTemplate>
</ListBox.ItemsPanel>
</ListBox>
</Grid>
</Window>


public partial class Window1 : Window
{
public Window1()
{
InitializeComponent();
}

private void Window_Loaded(object sender, RoutedEventArgs e)
{
lstItems.Items.Add(new MyPeopleData { FirstName = "Han", LastName = "Solo", Age = 45, FavoriteMovie = "Star Wars" });
lstItems.Items.Add(new MyPeopleData { FirstName = "James", LastName = "Kirk", Age = 36, FavoriteMovie = "Star Trek" });
lstItems.Items.Add(new MyPeopleData { FirstName = "Martha", LastName = "Jones", Age = 24, FavoriteMovie = "Dr. Who" });
lstItems.Items.Add(new MyPeopleData { FirstName = "Will", LastName = "Smith", Age = 32, FavoriteMovie = "Independance Day" });
lstItems.Items.Add(new MyPeopleData { FirstName = "Christian", LastName = "Bale", Age = 40, FavoriteMovie = "The Dark Knight" });
lstItems.Items.Add(new MyPeopleData { FirstName = "Hugh", LastName = "Jackman", Age = 46, FavoriteMovie = "Wolverine" });
}
}

public class MyPeopleData
{
public string FirstName { get; set; }
public string LastName { get; set; }
public int Age { get; set; }
public string FavoriteMovie { get; set; }
}

I want to enable context menu for the LSITBOXITEM. CAn any one help me how can i do this...

Santhapur
AnswerRe: How to enable Context menu for a listbox item. Pin
Pete O'Hanlon4-Sep-08 8:42
mvePete O'Hanlon4-Sep-08 8:42 
Questionparsing HTML files Pin
swatikavdia3-Sep-08 23:33
swatikavdia3-Sep-08 23:33 
AnswerRe: parsing HTML files Pin
Michael Sync18-Oct-08 22:02
Michael Sync18-Oct-08 22:02 
QuestionAudio conferencing using WCF and WPF Pin
sumantamca3-Sep-08 21:55
sumantamca3-Sep-08 21:55 
QuestionParsing XML files [modified] Pin
skrajasthan3-Sep-08 21:52
skrajasthan3-Sep-08 21:52 
GeneralRe: Parsing XML files Pin
Pete O'Hanlon14-Sep-08 22:54
mvePete O'Hanlon14-Sep-08 22:54 
Questionreading XML files Pin
swatikavdia3-Sep-08 21:08
swatikavdia3-Sep-08 21:08 
AnswerRe: reading XML files Pin
Michael Sync18-Oct-08 22:08
Michael Sync18-Oct-08 22:08 
QuestionTextbox validation Pin
Aslesh3-Sep-08 4:52
Aslesh3-Sep-08 4:52 
AnswerRe: Textbox validation Pin
Pete O'Hanlon3-Sep-08 10:21
mvePete O'Hanlon3-Sep-08 10:21 
QuestionHow to animate Expander ? Pin
hdv2123-Sep-08 1:17
hdv2123-Sep-08 1:17 
AnswerRe: How to animate Expander ? Pin
Pete O'Hanlon3-Sep-08 1:25
mvePete O'Hanlon3-Sep-08 1:25 
QuestionAbout eml file parsing in silverlight Pin
skrajasthan2-Sep-08 23:58
skrajasthan2-Sep-08 23:58 
QuestionAdvantages of Silver light for user using silver light application ? Pin
King Shez2-Sep-08 21:47
King Shez2-Sep-08 21:47 
QuestionHelp: Audio conferencing using WCF Pin
Jasvinder Kumar Bali2-Sep-08 20:53
Jasvinder Kumar Bali2-Sep-08 20:53 
QuestionSaving a image of WPF form Pin
shazaduh2-Sep-08 10:03
shazaduh2-Sep-08 10:03 
AnswerRe: Saving a image of WPF form Pin
Mark Salsbery2-Sep-08 10:48
Mark Salsbery2-Sep-08 10:48 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.