Click here to Skip to main content
15,892,480 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
C#
ToolStripMenuItem.DisplayStyle = Text
ToolStripMenuItem.Text = "test1";
ToolStripMenuItem.TextAlign = "MiddleLeft";

When the relevant attributes as I set ToolStripMenuItem, the string "test1" did not stop at the left, and the left there is a blank area, how can I let the string docked on the left side, I want to position or any.
Posted
Updated 22-Mar-15 19:29pm
v2

1 solution

I guess that the blank area you see on the left side of the first menu item is due to the padding of the Menu Strip itself.
The default value of the left padding is 6 pixels.
Change it by adding the following row
C#
this.menuStrip1.Padding = new System.Windows.Forms.Padding(0, 2, 0, 2);
 
Share this answer
 
v2

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