c# - Tri State Chech box for ToolStripDropDownButton -
i have statusbar strip toolstripmenuitems. need gruop toolstrip menu items , implement tristatecheckbox functionality,
to have three-state menu item, can set checkstate
of each toolstripmenuitem
indeterminate
, checked
or unchecked
.
also if want use tree-view control (which doesn't have builtin support three-state check boxes) or this control, should know, can host control in drop-down using toolstripcontrolhost
. example, here toolstriptreeview
control:
using system.componentmodel; using system.windows.forms; using system.windows.forms.design; [toolstripitemdesigneravailability(toolstripitemdesigneravailability.contextmenustrip)] public class toolstriptreeview : toolstripcontrolhost { [designerserializationvisibility( designerserializationvisibility.content)] public treeview treeviewcontrol { { return (treeview)control; } } public toolstriptreeview() : base(createcontrol()) { } private static treeview createcontrol() { var t = new treeview(); return t; } }
Comments
Post a Comment