I have combo box and button in my project(WPF application)
In following example I have change color of button when "ButtonName" press and other example I have change color of "Item3 and Item4" when selected.
Any idea how to change Background color of "Item3 and Item4" in combo box when "ButtonName" is press.?
[1]. Example1
[2]. Example2
- Thanks
Zohaib.
Santhosh Kumar JayaramanPosted Jul 11, 2012, 11:17 AM
private void btn_Click(object sender, RoutedEventArgs e)
{
ItemCollection ic = txtTitle.Items;
foreach (ComboBoxItem cbi in ic)
{
if (cbi.Content.ToString()=="Item3" ||cbi.Content.ToString()=="Item4")
cbi.Background = new SolidColorBrush(Color.FromArgb(255, 255, 182, 193));
}
}
zohaib khanPosted Jul 12, 2012, 3:49 AM
Many Thanks Santhosh