/// <summary> /// Creates a <see cref="CollapsibleMenuItemCollectionVWG"/> for a habaneroMenuItem. /// </summary> /// <param name="controlFactory"></param> /// <param name="habaneroMenuItem"></param> public CollapsibleMenuItemVWG(IControlFactory controlFactory, HabaneroMenu.Item habaneroMenuItem) { if (controlFactory == null) { throw new ArgumentNullException("controlFactory"); } _habaneroMenuItem = habaneroMenuItem; if (habaneroMenuItem != null) { this.Text = _habaneroMenuItem.Name; this.FlatStyle = FlatStyle.Flat; this.BackgroundImage = "Images.smBack-white.gif"; this.Image = "Images.nbItemBullet.gif"; this.TextImageRelation = TextImageRelation.ImageBeforeText; this.TextAlign = ContentAlignment.MiddleLeft; this.Font = new Font("Verdana", 9); this.Dock = DockStyleVWG.GetDockStyle(DockStyle.Top); this.Click += ChangeButtonIcon; } MenuItems = new CollapsibleMenuItemCollectionVWG(this); }
private void InitialiseSubMenuItem(string name) { this.Text = name; this.Name = name; this.PinLabel.Visible = false; this.CollapseButton.Text = name; this.Dock = DockStyleVWG.GetDockStyle(DockStyle.Top); this.CollapseButton.ForeColor = Color.White; this.CollapseButton.Font = new Font("Verdana", 10); ((ButtonVWG)this.CollapseButton).BackgroundImage = "Images.headergradient.png"; ((ButtonVWG)this.CollapseButton).FlatStyle = FlatStyle.Flat; this.Collapsed = true; this.CollapseButton.Click += delegate { if (this.Collapsed) { this.Collapsed = false; } }; this.MinimumSize = new System.Drawing.Size(this.CollapseButton.Width, this.CollapseButton.Height); this.Size = new System.Drawing.Size(this.CollapseButton.Width, this.CollapseButton.Height); MenuItems = new CollapsibleMenuItemCollectionVWG(this); }
/// <summary> /// Creates a <see cref="CollapsibleMenuItemCollectionVWG"/> with a name. /// </summary> /// <param name="name"></param> public CollapsibleMenuItemVWG(string name) { this.Text = name; MenuItems = new CollapsibleMenuItemCollectionVWG(this); }