Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
私は楽しみのために非常にシンプルなWP7アプリを開発しています。ビューにテキストボックスがあり、クリックすると背景色が白に変わります。テキストの前景も白であるため、テキストは表示されません。このデフォルトのスタイルを上書きする方法はありますか?
質問を正しく理解した場合は、次のように、GotFocusイベントのTextBoxの背景と前景のブラシを変更できます。
private void textBox1_GotFocus(object sender, RoutedEventArgs e) { textBox1.Background = new SolidColorBrush(Colors.Blue); textBox1.Foreground = new SolidColorBrush(Colors.Yellow); }