/// <summary> /// Construct a SearchableTreeView treeview control /// </summary> public SearchableTreeView() { InitializeComponent(); nodeSearcher = new NodeSearchDelegate(DefaultNodeSearch); // create default search delegate // Currently there is no designer support for adding menu item event handlers findToolStripMenuItem.Click += new EventHandler(findToolStripMenuItem_Click); }
// ~~~ constructor ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /// <summary> /// Creates a new instance /// of this control. /// </summary> public SBNTreeView() : base() { CheckBoxState cbsState; Graphics gfxCheckBox; Bitmap bmpCheckBox; _ilStateImages = new ImageList(); // first we create our state image cbsState = CheckBoxState.UncheckedNormal; // list and pre-init check state. for (int i = 0; i <= 2; i++) { // let's iterate each tri-state bmpCheckBox = new Bitmap(16, 16); // creating a new checkbox bitmap gfxCheckBox = Graphics.FromImage(bmpCheckBox); // and getting graphics object from switch (i) { // it... case 0: cbsState = CheckBoxState.UncheckedNormal; break; case 1: cbsState = CheckBoxState.CheckedNormal; break; case 2: cbsState = CheckBoxState.MixedNormal; break; } CheckBoxRenderer.DrawCheckBox(gfxCheckBox, new Point(2, 2), cbsState); // ...rendering the checkbox and... gfxCheckBox.Save(); _ilStateImages.Images.Add(bmpCheckBox); // ...adding to sate image list. _bUseTriState = true; } InitializeComponent(); nodeSearcher = new NodeSearchDelegate(DefaultNodeSearch); // create default search delegate // Currently there is no designer support for adding menu item event handlers findToolStripMenuItem.Click += new EventHandler(findToolStripMenuItem_Click); }