-
Jan 24th, 2018, 08:41 AM
#1
Thread Starter
Addicted Member
add button on a top of combobox item wpf
friends;
I want to add button on the top of combo box item to open another wpf window
i fill combo box items by code C#
how can i do that
-
Feb 13th, 2020, 03:55 AM
#2
Lively Member
I have try but not using button normal one click to redirect another page work like b
//ComboBoxCode.Xaml
<StackPanel Margin="10">
<ComboBox Name="ComboBox1" Width="200" Height="30" Margin="10,10,0,0" SelectionChanged="ComboBox1_SelectionChanged">
<ComboBoxItem Content="Top Item" ></ComboBoxItem>
<ComboBoxItem Content="1" ></ComboBoxItem>
<ComboBoxItem Content="2" ></ComboBoxItem>
</ComboBox>
</StackPanel>
//ComboBoxCode.Xaml.cs
private void ComboBox1_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
if(((ComboBoxItem)ComboBox1.SelectedItem).Content.ToString()=="Top Item")
{
Page1 newItem = new Page1();
newItem.Show();
}
}
Last edited by Prahlad; Feb 19th, 2020 at 11:34 PM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|