Click here to Skip to main content
15,884,628 members
Please Sign up or sign in to vote.
4.67/5 (2 votes)
Hi
In windows application , I have changed background color of a form to light green.
But the menu strip i have used in the form background is still in control color.

I checked in Form's property . but In property the back round color is light green.
In view menu strip background is in Control color.

How to change the color?
please help me

Thanks
Saranya1388
Posted
Updated 24-Apr-19 5:58am
v2
Comments
RDBurmon 13-Jun-12 9:26am    
Thanks Everyone who replied to this thread , So SwaxRak, I think you have got enough responses and you should be able to mark it as your answer and close the thread. Please do so.
SwaxRak 14-Jun-12 5:11am    
I marked the solution. tell me how to close the thread
[no name] 28-Jul-12 10:11am    
When any one click on MenuStrip, then the color get changed to white, How to handle that.
Question to SAKryukov or OriginalGriff only

Try:
C#
myMenuStrip.BackColor = Color.LightGreen;
 
Share this answer
 
Comments
TimGameDev 5-Mar-11 5:38am    
=) I've just understood that OP tries to change menustrip color via Form properties. 5 for attention :)
Sergey Alexandrovich Kryukov 5-Mar-11 23:57pm    
As easy as that, a 5.
--SA
If there are no standard properties that you need you can always create your own control, here is example:
Custom Rendering for the ToolStrip, MenuStrip, and StatusStrip controls[^]

And this example is not bad:
How to: Create and Set a Custom Renderer for the ToolStrip Control in Windows Forms[^]
 
Share this answer
 
v2
Comments
Sergey Alexandrovich Kryukov 5-Mar-11 23:57pm    
Correct but not quite relevant to this simple question (I didn't vote).
--SA
TimGameDev 6-Mar-11 1:29am    
Yes, I thought that OP tries to do something more than change the color(for example gradient)...I've already voted for OriginalGriff's answer.
Sergey Alexandrovich Kryukov 6-Mar-11 1:54am    
It's funny. You know, I help people for many years from time to time (well before CodeProject) and know the type of people who ask for help and will try to suck all of your blood. Such people are easy to spot. Do you know how? They start a question with "I _only_ want to..." [sorry, did not render Unicode - a defect! well, hope you understand...] :-)
--SA
TimGameDev 6-Mar-11 2:39am    
Yes, I know what you mean. Thanks for sharing your observation.
To be honest CodeProject has a lot of people "with only word" in the beginning of their questions...
I hope there will be less such people in my life :)
Sergey Alexandrovich Kryukov 6-Mar-11 3:21am    
Not that your life offers them: you're free to filter out some; also valid elsewhere in life...
--SA
select menustrip ->press f4(properties)--> back color
 
Share this answer
 
First you Create own ColorTable Function....
<pre><pre lang="c#">public  class TestColorTable : ProfessionalColorTable
{
    public override Color MenuItemSelected
    {
        get { return Color.Red; }
    }

    public override Color MenuBorder  //Change color according your Need
    {
        get { return Color.Green; }
    }

}


After Load in Your Foam .... eg:
C#
private void MainFoam_Load(object sender, EventArgs e)
{
    menuStrip1.Renderer = new ToolStripProfessionalRenderer(new TestColorTable());

}
 
Share this answer
 
Comments
CHill60 15-May-18 4:19am    
Or you could do it the nice easy way described in the Accepted answer from 7 years ago!
Solution 2 discussed a Renderer so at best you are just repeating what has already been said.
Stick to answering new questions where the OP still needs help. Make sure your solution is relevent to the question asked, and try to avoid repeating what other members have already said.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900