private void InitializeButton(string name, string text, Image image)
            {
                // Add ToolStrip button
                button                       = new ToolStripButton();
                button.Name                  = name;
                button.Text                  = text;
                button.Image                 = image;
                button.Margin                = new Padding(0);
                button.CheckOnClick          = true;
                button.CheckState            = CheckState.Unchecked;
                button.ImageAlign            = ContentAlignment.MiddleLeft;
                button.ImageScaling          = ToolStripItemImageScaling.SizeToFit;
                button.TextAlign             = ContentAlignment.MiddleLeft;
                button.TextDirection         = ToolStripTextDirection.Horizontal;
                button.ImageTransparentColor = Color.Black;
                button.Tag                   = this;

                // Add menu button
                //
                menuItem         = new ToolStripMenuItem();
                menuItem.Checked = true;
                menuItem.Tag     = button;
                menuItem.Name    = StackBar.GetMenuButtonNameFromButtonName(button.Name);
                menuItem.Text    = button.Text;
                menuItem.Image   = button.Image;
            }
Beispiel #2
0
 /// <summary>
 /// The StackBarButtonCollection class can only be instantiated by the StackBar class
 /// </summary>
 /// <param name="parentBar"></param>
 internal StackBarButtonCollection(StackBar parentBar)
 {
     parent = parentBar;
 }