Reputation: 3343
I am working on WPF, I want to change Background---color of textbox ( txtStatus.Background= white), but it is giving ERROR. Here my code is:
public Window2()
{
InitializeComponent();
txtStatus.Text = "Current Operation: NULL";
txtStatus.Background= white
}
Upvotes: 1
Views: 6452
Reputation: 27614
You need to use Brushes
:
txtStatus.Foreground = Brushes.White;
It contains a lot of colors, though if you want to use aRGB values then you can do it like this:
txtStatus.Foreground = new SolidBrush(Color.FromArgb(255, 0, 0, 255));
Upvotes: 7