c# - How to remove right side empty space in ToolStripMenuItem -
in screenshot marked empty space green rectangle, want left , right space equal size in toolstripmenuitem right side have bigger empty area 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; }
vb version (actually there 18 pixels arrow: 10 size , 8 margin, leave 2 pixels margin)
parent.dropdown.gettype.getfield("arrowpadding", reflection.bindingflags.nonpublic or reflection.bindingflags.static).setvalue(nothing, new padding(0, 0, -16, 0))
Comments
Post a Comment