Hello,
I am developing an Universal Windows Platform App using XAML & C#. I want to change Border Color of TextBox on Focus in UWP.
Thanks in advance for Help.
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Vinay SinghPosted Jul 6, 2016, 3:05 AM
{
SolidColorBrush brush = (sender as TextBox).Foreground as SolidColorBrush;
if (null != brush)
{
brush.Color = Colors.Red;
}
}
private void TextBox1_LostFocus(object sender, RoutedEventArgs e)
{
SolidColorBrush brush = (sender as TextBox).Foreground as SolidColorBrush;
if (null != brush)
{
brush.Color = Colors.Blue;
}
}