I am developing window phone 7 application. I am new to the silverlight. In my application I need a dynamic combobox. So I am using the following code
ComboBox CurrenciesCombobox = null;
CurrenciesCombobox = new ComboBox();
CurrenciesCombobox.Name = "CurrencyCombobox";
CurrenciesCombobox.SetValue(Canvas.TopProperty, 10.00);
CurrenciesCombobox.SetValue(Canvas.LeftProperty, 10.00);
CurrenciesCombobox.Margin = new Thickness(235, 395, 139, 180);
//CurrenciesCombobox.Foreground = ;
CurrenciesCombobox.ItemsSource = Currencies;
CurrenciesCombobox.SelectionChanged += new SelectionChangedEventHandler(CurrenciesCombobox_SelectionChanged);
ContentPanel.Children.Add(CurrenciesCombobox);
In the above code I am unaware of how to set the right hand side of the following statement
CurrenciesCombobox.Foreground = ;
Can you please tell me how to set the Foreground property of the combobx ?
Can you please provide me any code or link through which I can resolve the above issue ? If I am doing anything wrong then please guide me.
To set it to
White, use following code:which is same as following:
Second approach here provides more flexibility.
There are other types of Brushes as well:
Brushes in Silverlight.Also, while working with
Windows Phone 7, you should consider using theme colors. Take a look at available theme resources.