Border or Background color problem

Apr 30, 2013 at 11:21 AM
I cant change border or backgroud color of the control.

How can i do that ?

Thnx
Coordinator
May 2, 2013 at 6:12 PM
You can change the background and border color of a CurrencyTextBox the same way you would with any TextBox or control:
<currency:CurrencyTextBox Background="Purple" BorderBrush="Green" BorderThickness="2" />
Or you can modify the template of the control and have complete control over how it looks, but this is a more advanced approach.
May 3, 2013 at 8:29 AM
Yes, you rigth. Its ok in xaml but what about code side ?

I try like this but no change

__txtPriceSales.BorderBrush = Brushes.Red;
txtPriceSales.BorderBrush = new SolidColorBrush(Colors.Red);__

Thank you
Coordinator
May 3, 2013 at 7:36 PM
CurrencyTextBox behaves just like a TextBox from code-behind as well:
private void myCurrencyTextBox_Loaded(object sender, RoutedEventArgs e)
{
    var ctb = sender as CurrencyTextBox;
    ctb.BorderBrush = Brushes.Blue;
}
In fact, you can even cast the CurrencyTextBox down to a TextBox:
private void myCurrencyTextBox_Loaded(object sender, RoutedEventArgs e)
{
    var tb = sender as TextBox;
    tb.BorderBrush = Brushes.Blue;
}
If you feel that CurrencyTextBox is not behaving the same as TextBox, please create a new Issue and supply more detailed information.

Thanks