-
June 25th, 2019, 03:16 AM
#1
How to change foreground color of combobox by choose different value in wpf C#
bellow snipet code
xaml code:
<ComboBox x:Name="cb" SelectionChanged="ComboBox_SelectionChanged" Width="100" Height="25" IsEditable="True" Text="HelloWorld">
<ComboBoxItem Content="Coffie"></ComboBoxItem>
<ComboBoxItem Content="Tea"></ComboBoxItem>
<ComboBoxItem Content="Orange Juice"></ComboBoxItem>
<ComboBoxItem Content="Milk"></ComboBoxItem>
<ComboBoxItem Content="Iced Tea"></ComboBoxItem>
<ComboBoxItem Content="Mango Shake"></ComboBoxItem>
</ComboBox>
code behind:
private void ComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
if (__________ == "Milk")
{
code //
}
}
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
|