Click here to Skip to main content
Click here to Skip to main content
Add your own
alternative version
Go to top

ButtonBar Control using .NET

, 3 Dec 2009
Themed ButtonBar control supporting custom draw with full Designer support
namespace ButtonBarTest
{
    partial class MainForm
    {
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.IContainer components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing && (components != null))
            {
                components.Dispose();
            }
            base.Dispose(disposing);
        }

        #region Windows Form Designer generated code

        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.components = new System.ComponentModel.Container();
            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainForm));
            ButtonBarsControl.Control.BarItem barItem1 = new ButtonBarsControl.Control.BarItem();
            ButtonBarsControl.Control.BarItem barItem2 = new ButtonBarsControl.Control.BarItem();
            ButtonBarsControl.Control.BarItem barItem3 = new ButtonBarsControl.Control.BarItem();
            ButtonBarsControl.Control.BarItem barItem4 = new ButtonBarsControl.Control.BarItem();
            ButtonBarsControl.Control.BarItem barItem5 = new ButtonBarsControl.Control.BarItem();
            ButtonBarsControl.Control.BarItem barItem6 = new ButtonBarsControl.Control.BarItem();
            ButtonBarsControl.Control.BarItem barItem7 = new ButtonBarsControl.Control.BarItem();
            ButtonBarsControl.Control.BarItem barItem8 = new ButtonBarsControl.Control.BarItem();
            ButtonBarsControl.Control.BarItem barItem9 = new ButtonBarsControl.Control.BarItem();
            ButtonBarsControl.Control.BarItem barItem10 = new ButtonBarsControl.Control.BarItem();
            ButtonBarsControl.Control.BarItem barItem11 = new ButtonBarsControl.Control.BarItem();
            ButtonBarsControl.Control.BarItem barItem12 = new ButtonBarsControl.Control.BarItem();
            ButtonBarsControl.Control.BarItem barItem13 = new ButtonBarsControl.Control.BarItem();
            this.imageList1 = new System.Windows.Forms.ImageList(this.components);
            this.tabControl1 = new System.Windows.Forms.TabControl();
            this.tabPage1 = new System.Windows.Forms.TabPage();
            this.chkAlignment = new System.Windows.Forms.CheckBox();
            this.chkChangeSpacing = new System.Windows.Forms.CheckBox();
            this.chkDisabled = new System.Windows.Forms.CheckBox();
            this.chkShadow = new System.Windows.Forms.CheckBox();
            this.chkRound = new System.Windows.Forms.CheckBox();
            this.chkShowBorders = new System.Windows.Forms.CheckBox();
            this.bBarApp = new ButtonBarsControl.Control.ButtonBar(this.components);
            this.tabPage2 = new System.Windows.Forms.TabPage();
            this.chkUseTheme = new System.Windows.Forms.CheckBox();
            this.cbxTheme = new System.Windows.Forms.ComboBox();
            this.chkCustomDrawItems = new System.Windows.Forms.CheckBox();
            this.chkUseCustomDrawBackground = new System.Windows.Forms.CheckBox();
            this.bBarMain = new ButtonBarsControl.Control.ButtonBar(this.components);
            this.tabPage4 = new System.Windows.Forms.TabPage();
            this.richTextBox1 = new System.Windows.Forms.RichTextBox();
            this.bBarHit = new ButtonBarsControl.Control.ButtonBar(this.components);
            this.tabControl1.SuspendLayout();
            this.tabPage1.SuspendLayout();
            this.tabPage2.SuspendLayout();
            this.tabPage4.SuspendLayout();
            this.SuspendLayout();
            // 
            // imageList1
            // 
            this.imageList1.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imageList1.ImageStream")));
            this.imageList1.TransparentColor = System.Drawing.Color.White;
            this.imageList1.Images.SetKeyName(0, "smallfail.gif");
            this.imageList1.Images.SetKeyName(1, "smallsuccess.gif");
            // 
            // tabControl1
            // 
            this.tabControl1.Controls.Add(this.tabPage1);
            this.tabControl1.Controls.Add(this.tabPage2);
            this.tabControl1.Controls.Add(this.tabPage4);
            this.tabControl1.Dock = System.Windows.Forms.DockStyle.Fill;
            this.tabControl1.Location = new System.Drawing.Point(0, 0);
            this.tabControl1.Name = "tabControl1";
            this.tabControl1.SelectedIndex = 0;
            this.tabControl1.Size = new System.Drawing.Size(361, 212);
            this.tabControl1.TabIndex = 0;
            // 
            // tabPage1
            // 
            this.tabPage1.Controls.Add(this.chkAlignment);
            this.tabPage1.Controls.Add(this.chkChangeSpacing);
            this.tabPage1.Controls.Add(this.chkDisabled);
            this.tabPage1.Controls.Add(this.chkShadow);
            this.tabPage1.Controls.Add(this.chkRound);
            this.tabPage1.Controls.Add(this.chkShowBorders);
            this.tabPage1.Controls.Add(this.bBarApp);
            this.tabPage1.Location = new System.Drawing.Point(4, 22);
            this.tabPage1.Name = "tabPage1";
            this.tabPage1.Padding = new System.Windows.Forms.Padding(3);
            this.tabPage1.Size = new System.Drawing.Size(353, 186);
            this.tabPage1.TabIndex = 0;
            this.tabPage1.Text = "Appearance";
            this.tabPage1.UseVisualStyleBackColor = true;
            // 
            // chkAlignment
            // 
            this.chkAlignment.AutoSize = true;
            this.chkAlignment.Location = new System.Drawing.Point(142, 121);
            this.chkAlignment.Name = "chkAlignment";
            this.chkAlignment.Size = new System.Drawing.Size(123, 17);
            this.chkAlignment.TabIndex = 13;
            this.chkAlignment.Text = "Text Alignment (Left)";
            this.chkAlignment.UseVisualStyleBackColor = true;
            this.chkAlignment.CheckedChanged += new System.EventHandler(this.chkAlignment_CheckedChanged);
            // 
            // chkChangeSpacing
            // 
            this.chkChangeSpacing.AutoSize = true;
            this.chkChangeSpacing.Location = new System.Drawing.Point(142, 98);
            this.chkChangeSpacing.Name = "chkChangeSpacing";
            this.chkChangeSpacing.Size = new System.Drawing.Size(105, 17);
            this.chkChangeSpacing.TabIndex = 12;
            this.chkChangeSpacing.Text = "Change Spacing";
            this.chkChangeSpacing.UseVisualStyleBackColor = true;
            this.chkChangeSpacing.CheckedChanged += new System.EventHandler(this.chkChangeSpacing_CheckedChanged);
            // 
            // chkDisabled
            // 
            this.chkDisabled.AutoSize = true;
            this.chkDisabled.Location = new System.Drawing.Point(142, 75);
            this.chkDisabled.Name = "chkDisabled";
            this.chkDisabled.Size = new System.Drawing.Size(67, 17);
            this.chkDisabled.TabIndex = 11;
            this.chkDisabled.Text = "Disabled";
            this.chkDisabled.UseVisualStyleBackColor = true;
            this.chkDisabled.CheckedChanged += new System.EventHandler(this.chkDisabled_CheckedChanged);
            // 
            // chkShadow
            // 
            this.chkShadow.AutoSize = true;
            this.chkShadow.Location = new System.Drawing.Point(142, 52);
            this.chkShadow.Name = "chkShadow";
            this.chkShadow.Size = new System.Drawing.Size(105, 17);
            this.chkShadow.TabIndex = 10;
            this.chkShadow.Text = "Use shadow text";
            this.chkShadow.UseVisualStyleBackColor = true;
            this.chkShadow.CheckedChanged += new System.EventHandler(this.chkShadow_CheckedChanged);
            // 
            // chkRound
            // 
            this.chkRound.AutoSize = true;
            this.chkRound.Location = new System.Drawing.Point(142, 29);
            this.chkRound.Name = "chkRound";
            this.chkRound.Size = new System.Drawing.Size(108, 17);
            this.chkRound.TabIndex = 9;
            this.chkRound.Text = "Use round corner";
            this.chkRound.UseVisualStyleBackColor = true;
            this.chkRound.CheckedChanged += new System.EventHandler(this.chkRound_CheckedChanged);
            // 
            // chkShowBorders
            // 
            this.chkShowBorders.AutoSize = true;
            this.chkShowBorders.Checked = true;
            this.chkShowBorders.CheckState = System.Windows.Forms.CheckState.Checked;
            this.chkShowBorders.Location = new System.Drawing.Point(142, 6);
            this.chkShowBorders.Name = "chkShowBorders";
            this.chkShowBorders.Size = new System.Drawing.Size(92, 17);
            this.chkShowBorders.TabIndex = 7;
            this.chkShowBorders.Text = "Show Borders";
            this.chkShowBorders.UseVisualStyleBackColor = true;
            this.chkShowBorders.CheckedChanged += new System.EventHandler(this.chkShowBorders_CheckedChanged);
            // 
            // bBarApp
            // 
            this.bBarApp.AutoScroll = true;
            this.bBarApp.AutoScrollMinSize = new System.Drawing.Size(0, 102);
            this.bBarApp.ImageList = this.imageList1;
            this.bBarApp.ImageTransparency = 100;
            barItem1.Caption = "Button 1";
            barItem1.ImageAlignment = ButtonBarsControl.Design.Enums.ItemImageAlignment.Inherit;
            barItem1.ImageIndex = 0;
            barItem1.Selected = true;
            barItem1.ToolTipText = "Button 1";
            barItem2.Caption = "Button 2";
            barItem2.ImageAlignment = ButtonBarsControl.Design.Enums.ItemImageAlignment.Left;
            barItem2.ImageIndex = 1;
            barItem2.ToolTipText = "Button 2";
            barItem3.Caption = "Button 3";
            barItem3.ImageAlignment = ButtonBarsControl.Design.Enums.ItemImageAlignment.Inherit;
            barItem3.ToolTipText = "Button 3";
            this.bBarApp.Items.AddRange(new ButtonBarsControl.Control.BarItem[] {
            barItem1,
            barItem2,
            barItem3});
            this.bBarApp.Location = new System.Drawing.Point(3, 4);
            this.bBarApp.Name = "bBarApp";
            this.bBarApp.Padding = new System.Windows.Forms.Padding(3);
            this.bBarApp.Size = new System.Drawing.Size(120, 179);
            this.bBarApp.TabIndex = 6;
            // 
            // tabPage2
            // 
            this.tabPage2.Controls.Add(this.chkUseTheme);
            this.tabPage2.Controls.Add(this.cbxTheme);
            this.tabPage2.Controls.Add(this.chkCustomDrawItems);
            this.tabPage2.Controls.Add(this.chkUseCustomDrawBackground);
            this.tabPage2.Controls.Add(this.bBarMain);
            this.tabPage2.Location = new System.Drawing.Point(4, 22);
            this.tabPage2.Name = "tabPage2";
            this.tabPage2.Padding = new System.Windows.Forms.Padding(3);
            this.tabPage2.Size = new System.Drawing.Size(353, 186);
            this.tabPage2.TabIndex = 1;
            this.tabPage2.Text = "Custom Draw";
            this.tabPage2.UseVisualStyleBackColor = true;
            // 
            // chkUseTheme
            // 
            this.chkUseTheme.AutoSize = true;
            this.chkUseTheme.Location = new System.Drawing.Point(159, 49);
            this.chkUseTheme.Name = "chkUseTheme";
            this.chkUseTheme.Size = new System.Drawing.Size(81, 17);
            this.chkUseTheme.TabIndex = 9;
            this.chkUseTheme.Text = "Use Theme";
            this.chkUseTheme.UseVisualStyleBackColor = true;
            this.chkUseTheme.CheckedChanged += new System.EventHandler(this.chkUseTheme_CheckedChanged);
            // 
            // cbxTheme
            // 
            this.cbxTheme.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
            this.cbxTheme.FormattingEnabled = true;
            this.cbxTheme.Items.AddRange(new object[] {
            "Default",
            "VS2005",
            "Silver",
            "OliveGreen",
            "Blue",
            "Royal",
            "Classic"});
            this.cbxTheme.Location = new System.Drawing.Point(180, 72);
            this.cbxTheme.Name = "cbxTheme";
            this.cbxTheme.Size = new System.Drawing.Size(147, 21);
            this.cbxTheme.TabIndex = 8;
            this.cbxTheme.SelectedIndexChanged += new System.EventHandler(this.cbxTheme_SelectedIndexChanged);
            // 
            // chkCustomDrawItems
            // 
            this.chkCustomDrawItems.AutoSize = true;
            this.chkCustomDrawItems.Location = new System.Drawing.Point(159, 26);
            this.chkCustomDrawItems.Name = "chkCustomDrawItems";
            this.chkCustomDrawItems.Size = new System.Drawing.Size(133, 17);
            this.chkCustomDrawItems.TabIndex = 7;
            this.chkCustomDrawItems.Text = "Use CustomDrawItems";
            this.chkCustomDrawItems.UseVisualStyleBackColor = true;
            this.chkCustomDrawItems.CheckedChanged += new System.EventHandler(this.chkCustomDrawItems_CheckedChanged);
            // 
            // chkUseCustomDrawBackground
            // 
            this.chkUseCustomDrawBackground.AutoSize = true;
            this.chkUseCustomDrawBackground.Location = new System.Drawing.Point(159, 3);
            this.chkUseCustomDrawBackground.Name = "chkUseCustomDrawBackground";
            this.chkUseCustomDrawBackground.Size = new System.Drawing.Size(168, 17);
            this.chkUseCustomDrawBackground.TabIndex = 6;
            this.chkUseCustomDrawBackground.Text = "Use CustomDrawBackGround";
            this.chkUseCustomDrawBackground.UseVisualStyleBackColor = true;
            this.chkUseCustomDrawBackground.CheckedChanged += new System.EventHandler(this.chkUseCustomDrawBackground_CheckedChanged);
            // 
            // bBarMain
            // 
            this.bBarMain.AutoScroll = true;
            this.bBarMain.AutoScrollMinSize = new System.Drawing.Size(0, 86);
            barItem4.Caption = "Button 1";
            barItem4.ImageAlignment = ButtonBarsControl.Design.Enums.ItemImageAlignment.Inherit;
            barItem4.Selected = true;
            barItem4.ToolTipText = "Button 1";
            barItem5.Caption = "Button 2";
            barItem5.ImageAlignment = ButtonBarsControl.Design.Enums.ItemImageAlignment.Inherit;
            barItem5.ToolTipText = "Button 2";
            barItem6.Caption = "Button 3";
            barItem6.ImageAlignment = ButtonBarsControl.Design.Enums.ItemImageAlignment.Inherit;
            barItem6.ToolTipText = "Button 3";
            this.bBarMain.Items.AddRange(new ButtonBarsControl.Control.BarItem[] {
            barItem4,
            barItem5,
            barItem6});
            this.bBarMain.Location = new System.Drawing.Point(3, 3);
            this.bBarMain.Name = "bBarMain";
            this.bBarMain.Padding = new System.Windows.Forms.Padding(3);
            this.bBarMain.Size = new System.Drawing.Size(120, 179);
            this.bBarMain.TabIndex = 5;
            this.bBarMain.ThemeProperty.UseTheme = false;
            this.bBarMain.CustomDrawItems += new System.EventHandler<ButtonBarsControl.Design.Entity.DrawItemsEventArgs>(this.bBarMain_CustomDrawItems);
            this.bBarMain.CustomDrawBackGround += new System.EventHandler<ButtonBarsControl.Design.Entity.DrawBackGroundEventArgs>(this.bBarMain_CustomDrawBackGround);
            // 
            // tabPage4
            // 
            this.tabPage4.Controls.Add(this.richTextBox1);
            this.tabPage4.Controls.Add(this.bBarHit);
            this.tabPage4.Location = new System.Drawing.Point(4, 22);
            this.tabPage4.Name = "tabPage4";
            this.tabPage4.Padding = new System.Windows.Forms.Padding(3);
            this.tabPage4.Size = new System.Drawing.Size(353, 186);
            this.tabPage4.TabIndex = 3;
            this.tabPage4.Text = "HitTest";
            this.tabPage4.UseVisualStyleBackColor = true;
            // 
            // richTextBox1
            // 
            this.richTextBox1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            this.richTextBox1.Location = new System.Drawing.Point(146, 4);
            this.richTextBox1.Name = "richTextBox1";
            this.richTextBox1.ReadOnly = true;
            this.richTextBox1.Size = new System.Drawing.Size(204, 179);
            this.richTextBox1.TabIndex = 8;
            this.richTextBox1.Text = "";
            // 
            // bBarHit
            // 
            this.bBarHit.AutoScroll = true;
            this.bBarHit.AutoScrollMinSize = new System.Drawing.Size(0, 194);
            barItem7.Caption = "Button 1";
            barItem7.ImageAlignment = ButtonBarsControl.Design.Enums.ItemImageAlignment.Inherit;
            barItem7.Selected = true;
            barItem7.ToolTipText = "Button 1";
            barItem8.Caption = "Button 2";
            barItem8.ImageAlignment = ButtonBarsControl.Design.Enums.ItemImageAlignment.Inherit;
            barItem8.ToolTipText = "Button 2";
            barItem9.Caption = "Button 3";
            barItem9.ImageAlignment = ButtonBarsControl.Design.Enums.ItemImageAlignment.Inherit;
            barItem9.ToolTipText = "Button 3";
            barItem10.Caption = "Button 4";
            barItem10.ImageAlignment = ButtonBarsControl.Design.Enums.ItemImageAlignment.Inherit;
            barItem10.ToolTipText = "Button 4";
            barItem11.Caption = "Button 5";
            barItem11.ImageAlignment = ButtonBarsControl.Design.Enums.ItemImageAlignment.Inherit;
            barItem11.ToolTipText = "Button 5";
            barItem12.Caption = "Button 6";
            barItem12.ImageAlignment = ButtonBarsControl.Design.Enums.ItemImageAlignment.Inherit;
            barItem12.ToolTipText = "Button 6";
            barItem13.Caption = "Button 7";
            barItem13.ImageAlignment = ButtonBarsControl.Design.Enums.ItemImageAlignment.Inherit;
            barItem13.ToolTipText = "Button 7";
            this.bBarHit.Items.AddRange(new ButtonBarsControl.Control.BarItem[] {
            barItem7,
            barItem8,
            barItem9,
            barItem10,
            barItem11,
            barItem12,
            barItem13});
            this.bBarHit.Location = new System.Drawing.Point(3, 4);
            this.bBarHit.Name = "bBarHit";
            this.bBarHit.Padding = new System.Windows.Forms.Padding(3);
            this.bBarHit.Size = new System.Drawing.Size(137, 179);
            this.bBarHit.TabIndex = 7;
            this.bBarHit.Click += new System.EventHandler(this.buttonBar3_Click);
            // 
            // MainForm
            // 
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(361, 212);
            this.Controls.Add(this.tabControl1);
            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
            this.MaximizeBox = false;
            this.MinimizeBox = false;
            this.Name = "MainForm";
            this.Text = "MainForm";
            this.tabControl1.ResumeLayout(false);
            this.tabPage1.ResumeLayout(false);
            this.tabPage1.PerformLayout();
            this.tabPage2.ResumeLayout(false);
            this.tabPage2.PerformLayout();
            this.tabPage4.ResumeLayout(false);
            this.ResumeLayout(false);

        }

        #endregion

        private System.Windows.Forms.ImageList imageList1;
        private System.Windows.Forms.TabControl tabControl1;
        private System.Windows.Forms.TabPage tabPage1;
        private System.Windows.Forms.TabPage tabPage2;
        private System.Windows.Forms.CheckBox chkUseTheme;
        private System.Windows.Forms.ComboBox cbxTheme;
        private System.Windows.Forms.CheckBox chkCustomDrawItems;
        private System.Windows.Forms.CheckBox chkUseCustomDrawBackground;
        private ButtonBarsControl.Control.ButtonBar bBarMain;
        private ButtonBarsControl.Control.ButtonBar bBarApp;
        private System.Windows.Forms.CheckBox chkShowBorders;
        private System.Windows.Forms.TabPage tabPage4;
        private ButtonBarsControl.Control.ButtonBar bBarHit;
        private System.Windows.Forms.RichTextBox richTextBox1;
        private System.Windows.Forms.CheckBox chkRound;
        private System.Windows.Forms.CheckBox chkShadow;
        private System.Windows.Forms.CheckBox chkDisabled;
        private System.Windows.Forms.CheckBox chkChangeSpacing;
        private System.Windows.Forms.CheckBox chkAlignment;
    }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

Manish Ranjan Kumar
Software Developer (Senior)
India India
No Biography provided

| Advertise | Privacy | Mobile
Web02 | 2.8.140926.1 | Last Updated 3 Dec 2009
Article Copyright 2009 by Manish Ranjan Kumar
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid