/// <summary> /// Initializes a new instance of <see cref="DrawBackGroundEventArgs"/> with supplied arguments. /// </summary> /// <param name="graphics">Graphics surface where drawing has to be done.</param> /// <param name="bounds"><see cref="ButtonBar"/> control's boundry.</param> /// <param name="appearance">Appearance of current <see cref="ButtonBar"/></param> /// <param name="bar">Related <see cref="ButtonBar"/></param> public DrawBackGroundEventArgs(Graphics graphics, Rectangle bounds, AppearanceBar appearance, ButtonBar bar) { Graphics = graphics; Bounds = bounds; Appearance = appearance; Bar = bar; }
/// <summary> /// Initializes a new instance of <see cref="DrawItemEventArgs"/> with supplied arguments. /// </summary> /// <param name="ge">Graphics object where drawing will be done</param> /// <param name="bounds">Bound of <see cref="BarItem"/></param> /// <param name="item"><see cref="BarItem"/> to draw</param> /// <param name="state"><see cref="Enums.State"/> or <see cref="BarItem"/></param> /// <param name="bar"><see cref="ButtonBar"/> control</param> public DrawItemsEventArgs(Graphics ge, Rectangle bounds, BarItem item, State state, ButtonBar bar) { Handeled = false; Graphics = ge; Bounds = bounds; Item = item; State = state; Bar = bar; }
/// <summary> /// Initializes a new instance of the <see cref="BarItem"/> class with Specified owner of <see cref="BarItem"/> /// </summary> /// <param name="owner"></param> public BarItem(ButtonBar owner) { this.owner = owner; caption = GetCaption(); enabled = true; Height = 0; imageIndex = -1; MouseDown = false; MouseOver = false; selected = false; Top = 0; tag = null; toolTipText = caption; appearance = new AppearanceItem(); appearance.AppearanceChanged += OnAppearanceChanged; }
/// <summary> /// Initializes the designer with the specified component. /// </summary> /// <param name="component">The <see cref="T:System.ComponentModel.IComponent"/> to associate with the designer. </param> public override void Initialize(IComponent component) { base.Initialize(component); buttonBar = (ButtonBar) component; buttonBar.ThemeProperty.ThemeChanged += delegate { RefreshComponent(); }; buttonBar.SelectionChanged += delegate { RefreshComponent(); }; buttonBar.ItemsChanging += delegate { RefreshComponent(); }; buttonBar.ItemsClearing += delegate { RefreshComponent(); }; buttonBar.ItemsInserting += delegate { RefreshComponent(); }; buttonBar.ItemsRemoving += delegate { RefreshComponent(); }; buttonBar.ItemClick += delegate { RefreshComponent(); }; buttonBar.Appearance.Bar.AppearanceChanged += delegate { RefreshComponent(); }; buttonBar.Appearance.Item.AppearanceChanged += delegate { RefreshComponent(); }; designerActionList = new ButtonBarDesignerActionList(buttonBar); actionListCollection.Add(designerActionList); }
/// <summary> /// Initializes a new instance of the <see cref="BarItem"/> class. /// </summary> public BarItem() { caption = string.Empty; enabled = true; Height = 0; imageIndex = -1; MouseDown = false; MouseOver = false; owner = null; selected = false; Top = 0; tag = null; toolTipText = string.Empty; appearance = new AppearanceItem(); appearance.AppearanceChanged += OnAppearanceChanged; showBorder = ShowBorder.Inherit; }
public AppearanceEditorUI(ButtonBar original) { this.original = original; appBar = (AppearanceBar) original.Appearance.Bar.Clone(); appItem = (AppearanceItem) original.Appearance.Item.Clone(); InitializeComponent(); pgrdBar.SelectedObject = original.Appearance.Bar; pgrdItem.SelectedObject = original.Appearance.Item; lbxTemplate.Items.AddRange(new object[] { Resources.THEME_VS2005, Resources.THEME_CLASSIC, Resources.THEME_BLUE, Resources.THEME_OLIVE, Resources.THEME_ROYAL, Resources.THEME_SILVER }); lbxTemplate.SelectedIndex = 0; bBar.Appearance.Bar.Assign(appBar); bBar.Appearance.Item.Assign(appItem); bBar.ThemeProperty.UseTheme = false; bBar.SetThemeDefaults(); bBar.RefreshControl(); lblCurrentStyle.Text = Resources.LBL_CURRENT_STYLE; lblApply.Text = Resources.LNK_APPLYTHEME; lblAvailableTheme.Text = Resources.LBL_AVAILABLE_THEME; lblLoad.Text = Resources.LNK_LOAD; lblPreview.Text = Resources.LBL_PREVIEW; lblReload.Text = Resources.LNK_RELOAD; lblReset.Text = Resources.LNK_RESET; lblSave.Text = Resources.LNK_SAVETHEME; Text = Resources.FORM_TEXT; }
/// <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(); var barItem1 = new ButtonBarsControl.Control.BarItem(); var barItem2 = new ButtonBarsControl.Control.BarItem(); var barItem3 = new ButtonBarsControl.Control.BarItem(); var barItem4 = new ButtonBarsControl.Control.BarItem(); var barItem5 = new ButtonBarsControl.Control.BarItem(); var barItem6 = new ButtonBarsControl.Control.BarItem(); this.pnlTop = new System.Windows.Forms.Panel(); this.pnlRight = new System.Windows.Forms.Panel(); this.tabMain = new System.Windows.Forms.TabControl(); this.tpBar = new System.Windows.Forms.TabPage(); this.pgrdBar = new System.Windows.Forms.PropertyGrid(); this.tpItems = new System.Windows.Forms.TabPage(); this.pgrdItem = new System.Windows.Forms.PropertyGrid(); this.lblCurrentStyle = new System.Windows.Forms.Label(); this.pnlLeft = new System.Windows.Forms.Panel(); this.lblReload = new System.Windows.Forms.LinkLabel(); this.lblReset = new System.Windows.Forms.LinkLabel(); this.lblSave = new System.Windows.Forms.LinkLabel(); this.lblLoad = new System.Windows.Forms.LinkLabel(); this.lblPreview = new System.Windows.Forms.Label(); this.bBar = new ButtonBarsControl.Control.ButtonBar(this.components); this.lblAvailableTheme = new System.Windows.Forms.Label(); this.lblApply = new System.Windows.Forms.LinkLabel(); this.lbxTemplate = new System.Windows.Forms.ListBox(); this.pnlBottom = new System.Windows.Forms.Panel(); this.btnCancel = new System.Windows.Forms.Button(); this.btnOK = new System.Windows.Forms.Button(); this.pnlTop.SuspendLayout(); this.pnlRight.SuspendLayout(); this.tabMain.SuspendLayout(); this.tpBar.SuspendLayout(); this.tpItems.SuspendLayout(); this.pnlLeft.SuspendLayout(); this.pnlBottom.SuspendLayout(); this.SuspendLayout(); // // pnlTop // this.pnlTop.Controls.Add(this.pnlRight); this.pnlTop.Controls.Add(this.pnlLeft); this.pnlTop.Dock = System.Windows.Forms.DockStyle.Top; this.pnlTop.Location = new System.Drawing.Point(0, 0); this.pnlTop.Name = "pnlTop"; this.pnlTop.Size = new System.Drawing.Size(420, 441); this.pnlTop.TabIndex = 0; // // pnlRight // this.pnlRight.Controls.Add(this.tabMain); this.pnlRight.Controls.Add(this.lblCurrentStyle); this.pnlRight.Dock = System.Windows.Forms.DockStyle.Fill; this.pnlRight.Location = new System.Drawing.Point(179, 0); this.pnlRight.Name = "pnlRight"; this.pnlRight.Size = new System.Drawing.Size(241, 441); this.pnlRight.TabIndex = 1; // // tabMain // this.tabMain.Anchor = ((System.Windows.Forms.AnchorStyles) ((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.tabMain.Controls.Add(this.tpBar); this.tabMain.Controls.Add(this.tpItems); this.tabMain.Location = new System.Drawing.Point(3, 26); this.tabMain.Name = "tabMain"; this.tabMain.SelectedIndex = 0; this.tabMain.Size = new System.Drawing.Size(235, 409); this.tabMain.TabIndex = 2; // // tpBar // this.tpBar.Controls.Add(this.pgrdBar); this.tpBar.Location = new System.Drawing.Point(4, 22); this.tpBar.Name = "tpBar"; this.tpBar.Padding = new System.Windows.Forms.Padding(3); this.tpBar.Size = new System.Drawing.Size(227, 383); this.tpBar.TabIndex = 0; this.tpBar.Text = global::ButtonBarsControl.Properties.Resources.TAB_BAR; this.tpBar.UseVisualStyleBackColor = true; // // pgrdBar // this.pgrdBar.CommandsVisibleIfAvailable = false; this.pgrdBar.Dock = System.Windows.Forms.DockStyle.Fill; this.pgrdBar.HelpVisible = false; this.pgrdBar.Location = new System.Drawing.Point(3, 3); this.pgrdBar.Name = "pgrdBar"; this.pgrdBar.PropertySort = System.Windows.Forms.PropertySort.NoSort; this.pgrdBar.Size = new System.Drawing.Size(221, 377); this.pgrdBar.TabIndex = 1; this.pgrdBar.ToolbarVisible = false; // // tpItems // this.tpItems.Controls.Add(this.pgrdItem); this.tpItems.Location = new System.Drawing.Point(4, 22); this.tpItems.Name = "tpItems"; this.tpItems.Padding = new System.Windows.Forms.Padding(3); this.tpItems.Size = new System.Drawing.Size(227, 383); this.tpItems.TabIndex = 1; this.tpItems.Text = global::ButtonBarsControl.Properties.Resources.TAB_ITEMS; this.tpItems.UseVisualStyleBackColor = true; // // pgrdItem // this.pgrdItem.CommandsVisibleIfAvailable = false; this.pgrdItem.Dock = System.Windows.Forms.DockStyle.Fill; this.pgrdItem.HelpVisible = false; this.pgrdItem.Location = new System.Drawing.Point(3, 3); this.pgrdItem.Name = "pgrdItem"; this.pgrdItem.PropertySort = System.Windows.Forms.PropertySort.NoSort; this.pgrdItem.Size = new System.Drawing.Size(221, 377); this.pgrdItem.TabIndex = 2; this.pgrdItem.ToolbarVisible = false; // // lblCurrentStyle // this.lblCurrentStyle.AutoSize = true; this.lblCurrentStyle.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, ((System.Drawing.FontStyle) ((System.Drawing.FontStyle.Bold | System.Drawing.FontStyle.Underline)))); this.lblCurrentStyle.Location = new System.Drawing.Point(6, 9); this.lblCurrentStyle.Name = "lblCurrentStyle"; this.lblCurrentStyle.Size = new System.Drawing.Size(80, 13); this.lblCurrentStyle.TabIndex = 0; this.lblCurrentStyle.Text = "Current Style"; // // pnlLeft // this.pnlLeft.Controls.Add(this.lblReload); this.pnlLeft.Controls.Add(this.lblReset); this.pnlLeft.Controls.Add(this.lblSave); this.pnlLeft.Controls.Add(this.lblLoad); this.pnlLeft.Controls.Add(this.lblPreview); this.pnlLeft.Controls.Add(this.bBar); this.pnlLeft.Controls.Add(this.lblAvailableTheme); this.pnlLeft.Controls.Add(this.lblApply); this.pnlLeft.Controls.Add(this.lbxTemplate); this.pnlLeft.Dock = System.Windows.Forms.DockStyle.Left; this.pnlLeft.Location = new System.Drawing.Point(0, 0); this.pnlLeft.Name = "pnlLeft"; this.pnlLeft.Size = new System.Drawing.Size(179, 441); this.pnlLeft.TabIndex = 0; // // lblReload // this.lblReload.AutoSize = true; this.lblReload.Location = new System.Drawing.Point(6, 213); this.lblReload.Name = "lblReload"; this.lblReload.Size = new System.Drawing.Size(41, 13); this.lblReload.TabIndex = 8; this.lblReload.TabStop = true; this.lblReload.Text = "Re&load"; this.lblReload.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.OnReloadClicked); // // lblReset // this.lblReset.AutoSize = true; this.lblReset.Location = new System.Drawing.Point(6, 194); this.lblReset.Name = "lblReset"; this.lblReset.Size = new System.Drawing.Size(35, 13); this.lblReset.TabIndex = 7; this.lblReset.TabStop = true; this.lblReset.Text = "&Reset"; this.lblReset.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.OnResetClick); // // lblSave // this.lblSave.AutoSize = true; this.lblSave.Location = new System.Drawing.Point(6, 175); this.lblSave.Name = "lblSave"; this.lblSave.Size = new System.Drawing.Size(68, 13); this.lblSave.TabIndex = 6; this.lblSave.TabStop = true; this.lblSave.Text = "&Save Theme"; this.lblSave.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.OnSaveClick); // // lblLoad // this.lblLoad.AutoSize = true; this.lblLoad.Location = new System.Drawing.Point(6, 156); this.lblLoad.Name = "lblLoad"; this.lblLoad.Size = new System.Drawing.Size(67, 13); this.lblLoad.TabIndex = 5; this.lblLoad.TabStop = true; this.lblLoad.Text = "&Load Theme"; this.lblLoad.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.OnLoadClick); // // lblPreview // this.lblPreview.AutoSize = true; this.lblPreview.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, ((System.Drawing.FontStyle) ((System.Drawing.FontStyle.Bold | System.Drawing.FontStyle.Underline)))); this.lblPreview.Location = new System.Drawing.Point(6, 234); this.lblPreview.Name = "lblPreview"; this.lblPreview.Size = new System.Drawing.Size(52, 13); this.lblPreview.TabIndex = 3; this.lblPreview.Text = "Preview"; // // bBar // this.bBar.AutoScroll = true; this.bBar.AutoScrollMinSize = new System.Drawing.Size(0, 165); this.bBar.ButtonWidth = 150; barItem1.Caption = global::ButtonBarsControl.Properties.Resources.NORMAL_TEXT; barItem1.Selected = true; barItem1.Tag = "0"; barItem1.ToolTipText = global::ButtonBarsControl.Properties.Resources.NORMAL_TEXT; barItem2.Caption = global::ButtonBarsControl.Properties.Resources.DISABLED_TEXT; barItem2.Tag = "1"; barItem2.ToolTipText = global::ButtonBarsControl.Properties.Resources.DISABLED_TEXT; barItem3.Caption = global::ButtonBarsControl.Properties.Resources.SELECTED_TEXT; barItem3.Tag = "2"; barItem3.ToolTipText = global::ButtonBarsControl.Properties.Resources.SELECTED_TEXT; barItem4.Caption = global::ButtonBarsControl.Properties.Resources.CLICKED_TEXT; barItem4.Tag = "3"; barItem4.ToolTipText = global::ButtonBarsControl.Properties.Resources.CLICKED_TEXT; barItem5.Caption = global::ButtonBarsControl.Properties.Resources.HOVERED_TEXT; barItem5.Tag = "4"; barItem5.ToolTipText = global::ButtonBarsControl.Properties.Resources.HOVERED_TEXT; barItem6.Caption = global::ButtonBarsControl.Properties.Resources.SELECTED_HOVER_TEXT; barItem6.Tag = "5"; barItem6.ToolTipText = global::ButtonBarsControl.Properties.Resources.SELECTED_HOVER_TEXT; this.bBar.Items.AddRange(new ButtonBarsControl.Control.BarItem[] { barItem1, barItem2, barItem3, barItem4, barItem5, barItem6 }); this.bBar.Location = new System.Drawing.Point(7, 250); this.bBar.Name = "bBar"; this.bBar.Padding = new System.Windows.Forms.Padding(3); this.bBar.Size = new System.Drawing.Size(150, 189); this.bBar.TabIndex = 4; this.bBar.Text = "Button Bar"; this.bBar.ThemeProperty.UseTheme = false; this.bBar.CustomDrawItems += new System.EventHandler<ButtonBarsControl.Design.Entity.DrawItemsEventArgs>(this.OnCustomDrawItems); this.bBar.SelectionChanging += new ButtonBarsControl.Control.ItemChangingHandler(this.OnSelectionChanging); // // lblAvailableTheme // this.lblAvailableTheme.AutoSize = true; this.lblAvailableTheme.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, ((System.Drawing.FontStyle) ((System.Drawing.FontStyle.Bold | System.Drawing.FontStyle.Underline)))); this.lblAvailableTheme.Location = new System.Drawing.Point(6, 8); this.lblAvailableTheme.Name = "lblAvailableTheme"; this.lblAvailableTheme.Size = new System.Drawing.Size(103, 13); this.lblAvailableTheme.TabIndex = 0; this.lblAvailableTheme.Text = "Available themes"; // // lblApply // this.lblApply.AutoSize = true; this.lblApply.Location = new System.Drawing.Point(6, 137); this.lblApply.Name = "lblApply"; this.lblApply.Size = new System.Drawing.Size(117, 13); this.lblApply.TabIndex = 2; this.lblApply.TabStop = true; this.lblApply.Text = "&Apply to current Theme"; this.lblApply.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.OnApplyClick); // // lbxTemplate // this.lbxTemplate.FormattingEnabled = true; this.lbxTemplate.Location = new System.Drawing.Point(7, 26); this.lbxTemplate.Name = "lbxTemplate"; this.lbxTemplate.Size = new System.Drawing.Size(165, 108); this.lbxTemplate.TabIndex = 1; // // pnlBottom // this.pnlBottom.Controls.Add(this.btnCancel); this.pnlBottom.Controls.Add(this.btnOK); this.pnlBottom.Dock = System.Windows.Forms.DockStyle.Fill; this.pnlBottom.Location = new System.Drawing.Point(0, 441); this.pnlBottom.Name = "pnlBottom"; this.pnlBottom.Size = new System.Drawing.Size(420, 33); this.pnlBottom.TabIndex = 1; // // btnCancel // this.btnCancel.Anchor = ((System.Windows.Forms.AnchorStyles) ((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; this.btnCancel.Location = new System.Drawing.Point(333, 6); this.btnCancel.Name = "btnCancel"; this.btnCancel.Size = new System.Drawing.Size(75, 23); this.btnCancel.TabIndex = 1; this.btnCancel.Text = global::ButtonBarsControl.Properties.Resources.BTN_CANCEL; this.btnCancel.UseVisualStyleBackColor = true; this.btnCancel.Click += new System.EventHandler(this.OnCancelClick); // // btnOK // this.btnOK.Anchor = ((System.Windows.Forms.AnchorStyles) ((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.btnOK.DialogResult = System.Windows.Forms.DialogResult.OK; this.btnOK.Location = new System.Drawing.Point(252, 6); this.btnOK.Name = "btnOK"; this.btnOK.Size = new System.Drawing.Size(75, 23); this.btnOK.TabIndex = 0; this.btnOK.Text = global::ButtonBarsControl.Properties.Resources.BTN_OK; this.btnOK.UseVisualStyleBackColor = true; this.btnOK.Click += new System.EventHandler(this.OnOKClick); // // AppearanceEditorUI // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(420, 474); this.Controls.Add(this.pnlBottom); this.Controls.Add(this.pnlTop); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow; this.MaximizeBox = false; this.MinimizeBox = false; this.Name = "AppearanceEditorUI"; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; this.Text = "Appearance Editor"; this.pnlTop.ResumeLayout(false); this.pnlRight.ResumeLayout(false); this.pnlRight.PerformLayout(); this.tabMain.ResumeLayout(false); this.tpBar.ResumeLayout(false); this.tpItems.ResumeLayout(false); this.pnlLeft.ResumeLayout(false); this.pnlLeft.PerformLayout(); this.pnlBottom.ResumeLayout(false); this.ResumeLayout(false); }
private BarItem CreateBarItem(ButtonBar buttonBar, object tag, int icon, string caption, string toolTip) { BarItem barItem = new BarItem(); barItem.Caption = caption; barItem.ToolTipText = toolTip; barItem.ImageIndex = icon; barItem.Tag = tag; // 24 для 9 шрифта и 21 для 8го buttonBar.Height += 23; buttonBar.Parent.Height += 23; buttonBar.Items.Add(barItem); barItem.Selected = false; return barItem; }
private XPPanel CreateXpPanel(XPPanelGroup XPPanelGroup, ImageSet xpImageSet, string caption, int image) { XPPanel xpPanel = new XPPanel(); xpPanel.Name = "xpPanel"; xpPanel.Anchor = (AnchorStyles)((AnchorStyles.Top | AnchorStyles.Left) | AnchorStyles.Right); xpPanel.ForeColor = SystemColors.WindowText; xpPanel.BackColor = Color.Transparent; //xpPanel.Location = new Point(8, 8); xpPanel.Size = new Size(141, 100); xpPanel.TabIndex = 0; // Заголовок xpPanel.Caption = caption; xpPanel.Font = new Font("Courier New", 10F, FontStyle.Bold); //xpPanel.Font = new Font("Microsoft Sans Serif", 8F, FontStyle.Bold); xpPanel.TextColors.Foreground = Color.FromArgb(38, 115, 192); xpPanel.TextHighlightColors.Foreground = Color.FromArgb(38, 115, 192); xpPanel.VertAlignment = StringAlignment.Center; xpPanel.HorzAlignment = StringAlignment.Near; xpPanel.CaptionCornerType = XPPanelControl.CornerType.TopLeft | XPPanelControl.CornerType.TopRight; xpPanel.CurveRadius = 10; xpPanel.CaptionGradientMode = System.Drawing.Drawing2D.LinearGradientMode.Horizontal; xpPanel.CaptionGradient.Start = Color.FromArgb(254, 254, 254); xpPanel.CaptionGradient.End = Color.FromArgb(231, 236, 242); xpPanel.CollapsedGlyphs.ImageSet = xpImageSet; xpPanel.CollapsedGlyphs.Normal = 3; xpPanel.CollapsedGlyphs.Pressed = 2; xpPanel.CollapsedGlyphs.Highlight = 2; xpPanel.ExpandedGlyphs.ImageSet = xpImageSet; xpPanel.ExpandedGlyphs.Normal = 1; xpPanel.ExpandedGlyphs.Pressed = 0; xpPanel.ExpandedGlyphs.Highlight = 0; // Бордюр и фон xpPanel.CaptionUnderline = Color.FromArgb(254, 254, 254); xpPanel.OutlineColor = Color.FromArgb(254, 254, 254); xpPanel.PanelGradientMode = System.Drawing.Drawing2D.LinearGradientMode.Horizontal; xpPanel.PanelGradient.Start = Color.FromArgb(243, 245, 248); xpPanel.PanelGradient.End = Color.FromArgb(243, 245, 248); ButtonBar btnBar = new ButtonBar(); // Фон btnBar.Dock = DockStyle.Fill; btnBar.ThemeProperty.ColorScheme = ColorScheme.Default; btnBar.ThemeProperty.UseTheme = false; btnBar.Appearance.Bar.BackStyle.BackColor1 = Color.FromArgb(243, 245, 248); btnBar.Appearance.Bar.BackStyle.BackColor2 = Color.FromArgb(243, 245, 248); btnBar.Appearance.Bar.AppearanceBorder.BorderVisibility = ToolStripStatusLabelBorderSides.None; btnBar.Appearance.Bar.CornerRadius = 0; // Отступы btnBar.Spacing = -1; btnBar.Padding = new Padding(10, 8, 10, 8); XPPanelGroup.Controls.Add(xpPanel); return xpPanel; }
private ButtonBar CreateButtonBar(XPPanel xpPanel, ImageList imageList) { ButtonBar buttonBar = new ButtonBar(); buttonBar.ImageList = imageList; buttonBar.ThemeProperty.UseTheme = false; buttonBar.HorizontalScroll.Visible = false; buttonBar.VerticalScroll.Visible = false; buttonBar.ShowBorders = true; // фон Bar'а buttonBar.Appearance.Bar.BackStyle.BackColor1 = Color.FromArgb(243, 245, 248); buttonBar.Appearance.Bar.BackStyle.BackColor2 = Color.FromArgb(243, 245, 248); // граница Bar'а buttonBar.Appearance.Bar.FocusedBorder = Color.FromArgb(243, 245, 248); buttonBar.Appearance.Bar.NormalBorder = Color.FromArgb(243, 245, 248); // фон Item'а buttonBar.Appearance.Item.BackStyle.BackColor1 = Color.FromArgb(243, 245, 248); buttonBar.Appearance.Item.BackStyle.BackColor2 = Color.FromArgb(243, 245, 248); buttonBar.Appearance.Item.HoverStyle.BackColor1 = Color.FromArgb(228, 238, 248); buttonBar.Appearance.Item.HoverStyle.BackColor2 = Color.FromArgb(228, 238, 248); buttonBar.Appearance.Item.ClickStyle.BackColor1 = Color.FromArgb(153, 204, 255); buttonBar.Appearance.Item.ClickStyle.BackColor2 = Color.FromArgb(153, 204, 255); buttonBar.Appearance.Item.SelectedStyle.BackColor1 = Color.FromArgb(192, 221, 252); buttonBar.Appearance.Item.SelectedStyle.BackColor2 = Color.FromArgb(192, 221, 252); buttonBar.Appearance.Item.SelectedHoverStyle.BackColor1 = Color.FromArgb(153, 204, 255); buttonBar.Appearance.Item.SelectedHoverStyle.BackColor2 = Color.FromArgb(153, 204, 255); // граница Item'а buttonBar.Appearance.Item.NormalBorder = Color.FromArgb(243, 245, 248); buttonBar.Appearance.Item.HoverBorder = Color.FromArgb(51, 153, 255); buttonBar.Appearance.Item.SelectedBorder = Color.FromArgb(51, 153, 255); buttonBar.Appearance.Item.AppearenceText.Font = new Font("Courier New", 9F, FontStyle.Regular); buttonBar.Appearance.Item.AppearenceText.Alignment = StringAlignment.Near; buttonBar.ImageAlignment = ImageAlignment.Left; buttonBar.Padding = new Padding(10, 8, 10, 8); buttonBar.Spacing = 0; xpPanel.Controls.Add(buttonBar); buttonBar.Location = new Point(1, 31); //buttonBar.Width = 174; buttonBar.Height = 30; xpPanel.Height = 20 + 28; return buttonBar; }
public ControlPanelGroup(ControlPanel parent, string caption, int image) { Parent = parent; m_XPPanel = CreateXpPanel(parent.XPPanelGroup, parent.ImageSet, caption, image); m_ButtonBar = CreateButtonBar(m_XPPanel, ImageList ?? parent.ImageList); m_ButtonBar.ItemClick += new GenericClickEventHandler<BarItem>(ButtonBar_ItemClick); }