
In screenshot i marked that empty space with green rectangle, i want left and right space to be equal size in ToolStripMenuItem but right side have bigger empty area which i can't remove.
Codes:
private void UpdateWorkflowsMenu()
{
((ToolStripDropDownMenu)tsddbWorkflows.DropDown).ShowImageMargin = false;
tsddbWorkflows.DropDownItems.Clear();
Program.HotkeyManager.Hotkeys.ForEach<HotkeySettings>(x =>
{
if (x.TaskSettings.Job != HotkeyType.None && (!Program.Settings.WorkflowsOnlyShowEdited || !x.TaskSettings.IsUsingDefaultSettings))
{
ToolStripMenuItem tsmi = new ToolStripMenuItem(x.TaskSettings.Description);
if (x.HotkeyInfo.IsValidHotkey) tsmi.ShortcutKeyDisplayString = " " + x.HotkeyInfo.ToString();
tsmi.Click += (sender, e) => HandleTask(x.TaskSettings);
tsddbWorkflows.DropDownItems.Add(tsmi);
}
});
tsddbWorkflows.Visible = tsddbWorkflows.DropDownItems.Count > 0;
}
As answered above this space is reserved for 'open submenu' arrow, and in general I do not recommend to touch this, but of course it is possible to remove that space. And actually there is several methods to do that, but all of them require some coding. Here the snippet for simplest way to do that, you must know expected width however (it can be calculated via ToolstripItem.GetPreferredSize):
ToolStip engine in general very flexible and it is possible to implement very interesting things using it when you know its internals.