1

I have statusbar strip with ToolStripMenuItems. I need to gruop the Toolstrip menu items and Implement TriStateCheckbox functionality,

  1. Is it Possible to Create checkbox with ToolStripMenitems?
  2. If its not Possible for Point 1, then How to Add TreeView to StatusStrip. enter image description here
Reza Aghaei
  • 120,393
  • 18
  • 203
  • 398
user1645200
  • 135
  • 2
  • 13

1 Answers1

1

To have a three-state menu item, you can set CheckState of each ToolStripMenuItem to Indeterminate, Checked or Unchecked.

enter image description here

Also if you want to use a tree-view control (which doesn't have builtin support for three-state check boxes) or something like this control, you should know, you can host any control in drop-down using ToolStripControlHost. For example, here is a 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 { get { return (TreeView)Control; } }
    public ToolStripTreeView() : base(CreateControl()) { }
    private static TreeView CreateControl()
    {
        var t = new TreeView();
        return t;
    }
}

enter image description here

Reza Aghaei
  • 120,393
  • 18
  • 203
  • 398