Hi Yogesh,
In Addition to João Cardoso.
You have to set few properties see below code snippet for the same.
XAML code
Code:
<TextBox GotFocus="textBox1_GotFocus" Background="YellowGreen" BorderBrush="Red" BorderThickness="1" Foreground="Black" Height="72" HorizontalAlignment="Left" Margin="94,414,0,0" Name="textBox1" Text="" VerticalAlignment="Top" Width="281" />
C# Code
Code:
private void textBox1_GotFocus(object sender, RoutedEventArgs e)
{
Visibility lightThemeVisible = (Visibility)Resources["PhoneLightThemeVisibility"];
if (lightThemeVisible == System.Windows.Visibility.Visible)
{
// do code for light theme
textBox1.Background = new SolidColorBrush(Colors.Red);
}
else
{
// do code for dark theme
textBox1.Background = new SolidColorBrush(Colors.Green);
}
}
However you can also have a look this article for handling Theme in WP7 TextBox Light theme problems - the solution
Hope it helps.