\n
This what I have in mind:
\n\nThanks.
\n","author":{"@type":"Person","name":"Michele Colle"},"upvoteCount":1,"answerCount":1,"acceptedAnswer":{"@type":"Answer","text":"could you be more clear about what do you mean by "flat" please ?
\nI tested the creation of one ToolStrip, added two buttons in it, set the DisplayStyle property of both of them to "Text", and I get that: "Flat" toolstrip buttons
\nHow could it be "flatter" ?\nWhat problem do you have with the ToolStrip exactly ?
\nThank you in advance, have a nice day !
\nEdit:
\nI see your problem, and following that link, You can get the solution.\nThe solution is, create your own ToolStrip border Renderer that does nothing.
\nThe problem is basically a bug in the built-in Microsoft's Toolstrip renderer, which we can fix by creating our own without telling to render these borders.
\nTo do so, go to the concerned Form, click the arrow left to it, go to [form].Designer.cs, and add this code before the form class:
\n public class MySR: System.Windows.Forms.ToolStripSystemRenderer\n {\n public MySR() { }\n protected override void OnRenderToolStripBorder(ToolStripRenderEventArgs e){}\n }\n
\nAnd set the "Renderer" property of the ToolStrip to "new MySr()", still in the same file, in the Form's "InitializeComponent" function:
\n// \n//[Your toolstrip name, let's say myToolStrip]\n//\nthis.myToolStrip.Renderer = new MySR();\n
\nHope it can help !\nHave a nice day.
\n","author":{"@type":"Person","name":"Linkruste Addict"},"upvoteCount":1}}}Reputation: 48
I'm working with C# on a windows form application (.NETFramework 4.8) and I'm trying to make a ToolStrip menu that looks very flat like the Visual Studio toolbars, how can this be done? I also cant get rid of the white line under the toolstrip.
This is the best result so far (I selected the same background colors but they look different):
This what I have in mind:
Thanks.
Upvotes: 1
Views: 911
Reputation: 69
could you be more clear about what do you mean by "flat" please ?
I tested the creation of one ToolStrip, added two buttons in it, set the DisplayStyle property of both of them to "Text", and I get that: "Flat" toolstrip buttons
How could it be "flatter" ? What problem do you have with the ToolStrip exactly ?
Thank you in advance, have a nice day !
Edit:
I see your problem, and following that link, You can get the solution. The solution is, create your own ToolStrip border Renderer that does nothing.
The problem is basically a bug in the built-in Microsoft's Toolstrip renderer, which we can fix by creating our own without telling to render these borders.
To do so, go to the concerned Form, click the arrow left to it, go to [form].Designer.cs, and add this code before the form class:
public class MySR: System.Windows.Forms.ToolStripSystemRenderer
{
public MySR() { }
protected override void OnRenderToolStripBorder(ToolStripRenderEventArgs e){}
}
And set the "Renderer" property of the ToolStrip to "new MySr()", still in the same file, in the Form's "InitializeComponent" function:
//
//[Your toolstrip name, let's say myToolStrip]
//
this.myToolStrip.Renderer = new MySR();
Hope it can help ! Have a nice day.
Upvotes: 1