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.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend4days leftRegister
Vinay SinghRank #604 · 4K reputationPosted Jul 5, 2016, 11:05 PM EDT
{
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;
}
}