How to apply a different color then the system color to the main f

  • Thread starter Thread starter Guest
  • Start date Start date
Although you can do it programatically,
go to the Properties window
there you will see BackColor
click on it
you will get color options
 
Thanks but I don't want to the change the windows color just because I want
One application to look different.

How do I do it using c# ?

thanks again, Udi Raz
 
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.

If you find a way out let me know.
 
Hi Zach,

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.

I think we need to override onDrawItem event.

I'll let you know......

Bye, Udi
 
Hi Udir,

***
(First remark)
It didn't change anything !!!!!
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.
***

Cheers,
Zach,
(e-mail address removed)
 
Hi Zach,

I know what my problem is. The problem is that the subject of this form is
too short and you could see the end of my question :-)

I would like to change the color of the main form menu and toolbar !!! not
the main form window.

Now... do you have anything to me ???

b.t.w.

where are you from ?

Bye, Udi
 
Back
Top