Technically you could do it by changing the back color
of the form in question into "public" and then changing
that color from elsewhere in the system, like you would
change any other value (assuming you are doing that
directly - i.e., without a get / set operation, which some
would say is bad practice).
However, my experience is that if you try to change the color
of a form from elsewhere in the system Visual C#.Net gets into
a mess.
I tried to do it once, because I wanted to give the user of
the system the option of changing screen colors etc. to his
personal liking. But Visual Studio started protesting.
before permiting other to change the color of the form I tired to change it
within the code as following : this.BackColor = Color.Chocolate; ( on
InitializeComponent() )
It didn't change anything !!!!!
I think that microsoft didn't ment to let us do it, otherwise the form
backColor was a field on the properties view.
Yes it does;
either stick it in the constructor,
or stick it in Form_Load(...)
this.BackColor.Chocolate;
***
(Second remark)
// If you have a Form1 and a Form2, then put in
Form1_Load(object sender, System.EventArgs e)
{
Form2 F2 = new Form2( )
F2.BackColor = Color.Chocolate;
F2.Show( );
}
//Then bingo.
***
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.