当前位置: 首页>>代码示例>>C#>>正文


C# DotNetBar.ButtonItem类代码示例

本文整理汇总了C#中DevComponents.DotNetBar.ButtonItem的典型用法代码示例。如果您正苦于以下问题:C# ButtonItem类的具体用法?C# ButtonItem怎么用?C# ButtonItem使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


ButtonItem类属于DevComponents.DotNetBar命名空间,在下文中一共展示了ButtonItem类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: PanelExTitle

        public PanelExTitle()
        {
            m_ExpandChangeButton = new ButtonItem("close");
            m_ExpandChangeButton.Style = eDotNetBarStyle.Office2003;
            m_ExpandChangeButton.Image = BarFunctions.LoadBitmap("SystemImages.CollapseTitle.png");
            m_ExpandChangeButton.Displayed = true;
            m_ExpandChangeButton.Click += new EventHandler(m_ExpandChangeButton_Click);

            m_ItemContainer = new ItemContainer();
            m_ItemContainer.ContainerControl = this;
            m_ItemContainer.Style = eDotNetBarStyle.Office2003;
            m_ItemContainer.SubItems.Add(m_ExpandChangeButton);
            base.MarkupUsesStyleAlignment = true;
        }
开发者ID:,项目名称:,代码行数:14,代码来源:

示例2: HomeOperation

        //开始操作
        public void HomeOperation(ButtonItem button)
        {
            string action = button.Text;
            switch (action)
            {
                case "openmxd":
                    OpenMXD();
                    break;
                case "zoomin":
                    MapNavigation("zoomin");
                    break;
                case "点":
                    SpatialQuery(action);
                    break;
                case "attributequery":
                    AttributeQuery();
                    break;
                case "adddata":
                    AddData();
                    break;
                default:

                    break;
            }


        }
开发者ID:gistop,项目名称:aegis,代码行数:28,代码来源:Home.cs

示例3: defaultToolMenu

        private void defaultToolMenu()
        {
            //ButtonItem toolbarItem0 = new ButtonItem("redept", "切换科室");

            //toolbarItem0.ImageFixedSize = new Size(30, 30);
            //toolbarItem0.Image = Image.FromFile(@"images\1.png");
            //toolbarItem0.ImagePosition = eImagePosition.Top;
            ButtonItem toolbarItem1 = new ButtonItem("relogin", "切换用户");
            toolbarItem1.ImageFixedSize = new Size(30, 30);
            toolbarItem1.Image = Image.FromFile(AppGlobal.AppRootPath + @"images\2.png");
            toolbarItem1.ImagePosition = eImagePosition.Top;
            ButtonItem toolbarItem2 = new ButtonItem("changepassword", "修改密码");
            toolbarItem2.ImageFixedSize = new Size(30, 30);
            toolbarItem2.Image = Image.FromFile(AppGlobal.AppRootPath + @"images\3.png");
            toolbarItem2.ImagePosition = eImagePosition.Top;
            ButtonItem toolbarItem3 = new ButtonItem("welcome", "系统首页");
            toolbarItem3.BeginGroup = true;
            toolbarItem3.ImageFixedSize = new Size(30, 30);
            toolbarItem3.Image = Image.FromFile(AppGlobal.AppRootPath + @"images\1.png");
            toolbarItem3.ImagePosition = eImagePosition.Top;

            ButtonItem toolbarItem4 = new ButtonItem("close", "最小化系统");
            toolbarItem4.ImageFixedSize = new Size(30, 30);
            toolbarItem4.Image = Image.FromFile(AppGlobal.AppRootPath + @"images\4.png");
            toolbarItem4.ImagePosition = eImagePosition.Top;
            toolbarItem4.BeginGroup = true;

            this.barMainToolBar.Items.AddRange(new BaseItem[] { toolbarItem3, 
                //toolbarItem0, 
                toolbarItem1, toolbarItem2, toolbarItem4 });
        }
开发者ID:keep01,项目名称:efwplus_winformframe,代码行数:31,代码来源:FrmMain.cs

示例4: CreateButtonPainter

        public static ButtonItemPainter CreateButtonPainter(ButtonItem button)
        {
            if (button is RibbonTabItem)
            {
                return CreateRibbonTabItemPainter((RibbonTabItem)button);
            }
            if (button is RibbonOverflowButtonItem)
            {
                ButtonItemPainter p = CreateRibbonOverflowButtonPainter((RibbonOverflowButtonItem)button);
                if (p != null)
                    return p;
            }

            eDotNetBarStyle buttonEffectiveStyle = button.EffectiveStyle;
            if (buttonEffectiveStyle == eDotNetBarStyle.Office2010 && button.ContainerState == eContainerState.NavigationPane)
            {
                return _Office2010NavPaneButtonPainter;
            }
            
            if (buttonEffectiveStyle == eDotNetBarStyle.Office2010 && button is ApplicationButton)
                return Office2010ApplicationButtonPainter;
            else if (button is DevComponents.DotNetBar.Metro.MetroAppButton || button is ApplicationButton && buttonEffectiveStyle == eDotNetBarStyle.Metro)
                return MetroAppButtonPainter;

            if (BarFunctions.IsOffice2007Style(buttonEffectiveStyle))
            {
                if (buttonEffectiveStyle == eDotNetBarStyle.Metro)
                    return m_MetroButtonPainter;
                if (button.ContainerControl is RibbonBar)
                    return m_Office2007Painter;
                return m_Office2007Painter;
            }
            return m_Office2003Painter;
        }
开发者ID:,项目名称:,代码行数:34,代码来源:

示例5: GetTextRectangle

 protected override Rectangle GetTextRectangle(ButtonItem button, ItemPaintArgs pa, eTextFormat stringFormat, CompositeImage image)
 {
     Rectangle r = base.GetTextRectangle(button, pa, stringFormat, image);
     if (image == null && string.IsNullOrEmpty(button.Symbol))
         r.Inflate(-3, 0);
     return r;
 }
开发者ID:,项目名称:,代码行数:7,代码来源:

示例6: CreateChildMenus

        private RibbonBar CreateChildMenus(MenuInfo subMenuInfo)
        {
            ButtonItem buttonItem = new DevComponents.DotNetBar.ButtonItem();
            buttonItem.Name = subMenuInfo.MenuID;
            buttonItem.Text = subMenuInfo.MenuName;
            buttonItem.ButtonStyle = DevComponents.DotNetBar.eButtonStyle.ImageAndText;
            //buttonItem.Image = ((System.Drawing.Image)(resourceManager.GetObject("buttonItem1.Image")));
            //buttonItem.Image = ((System.Drawing.Image)(resourceManager.GetObject("OpenExistingPlace")));
            buttonItem.Image = imageList.Images["OpenExistingPlace"];
            buttonItem.ImagePosition = DevComponents.DotNetBar.eImagePosition.Top;
            buttonItem.RibbonWordWrap = false;
            buttonItem.Visible = true;

            DevComponents.DotNetBar.RibbonBar ribbonBar = new DevComponents.DotNetBar.RibbonBar();

            ribbonBar.AutoOverflowEnabled = true;
            ribbonBar.BackgroundMouseOverStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square;
            ribbonBar.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square;
            ribbonBar.ContainerControlProcessDialogKey = true;
            ribbonBar.Items.AddRange(new DevComponents.DotNetBar.BaseItem[] {
            buttonItem});
            ribbonBar.Location = new System.Drawing.Point(3, 0);
            ribbonBar.Name = System.Guid.NewGuid().ToString();
            ribbonBar.Size = new System.Drawing.Size(337, 82);
            ribbonBar.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
            ribbonBar.TabIndex = 0;
            //ribbonBar.Text = subMenuInfo.MenuName;
            ribbonBar.TitleStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square;
            ribbonBar.TitleStyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square;
            ribbonBar.Visible = true;

            return ribbonBar;
        }
开发者ID:EinsteinOrg,项目名称:einstein,代码行数:33,代码来源:Navigations.cs

示例7: PaintButtonBackground

        public override void PaintButtonBackground(ButtonItem button, ItemPaintArgs pa, CompositeImage image)
		{
            bool isOnMenu = IsOnMenu(button, pa);
			if(isOnMenu)
				base.PaintButtonBackground(button,pa, image);
			else
				PaintButtonCheck(button,pa,image,button.DisplayRectangle);
		}
开发者ID:,项目名称:,代码行数:8,代码来源:

示例8: PaintButtonMouseOver

 /// <summary>
 /// Paints state of the button, either hot, pressed or checked
 /// </summary>
 /// <param name="button"></param>
 /// <param name="pa"></param>
 /// <param name="image"></param>
 public override void PaintButtonMouseOver(ButtonItem button, ItemPaintArgs pa, CompositeImage image, Rectangle r)
 {
     if (IsOffice2003Rendering(button, pa))
     {
         base.PaintButtonMouseOver(button, pa, image, r);
         return;
     }
     //PaintState(button, pa, image, r, button.IsMouseDown);
 }
开发者ID:,项目名称:,代码行数:15,代码来源:

示例9: GetButtonShape

        protected virtual IShapeDescriptor GetButtonShape(ButtonItem button, ItemPaintArgs pa)
        {
            IShapeDescriptor shape = Office2007ButtonItemPainter.GetButtonShape(button);

            if (pa.ContainerControl is ButtonX)
                shape = ((ButtonX)pa.ContainerControl).GetButtonShape();
            else if (pa.ContainerControl is NavigationBar)
                shape = ((NavigationBar)pa.ContainerControl).ButtonShape;
            return shape;
        }
开发者ID:,项目名称:,代码行数:10,代码来源:

示例10: MainForm

        StartControl _StartControl = null; // Start control displayed on startup

        #endregion Fields

        #region Constructors

        public MainForm()
        {
            InitializeComponent();

            // Prepare commands
            _Commands = new MetroBillCommands();

            _Commands.ToggleStartControl = new Command(components);
            _Commands.ToggleStartControl.Executed += new EventHandler(ToggleStartControlExecuted);

            // Initialize Client related commands
            _Commands.ClientCommands.New = new Command(components); // We pass in components from Form so the command gets disposed automatically when form is disposed
            _Commands.ClientCommands.New.Executed += NewClientExecuted;
            _Commands.ClientCommands.Cancel = new Command(components);
            _Commands.ClientCommands.Cancel.Executed += CancelClientExecuted;
            _Commands.ClientCommands.Save = new Command(components);
            _Commands.ClientCommands.Save.Executed += SaveClientExecuted;
            // Invoice related commands
            _Commands.InvoiceCommands.New = new Command(components); // We pass in components from Form so the command gets disposed automatically when form is disposed
            _Commands.InvoiceCommands.New.Executed += NewInvoiceExecuted;
            _Commands.InvoiceCommands.Cancel = new Command(components);
            _Commands.InvoiceCommands.Cancel.Executed += CancelInvoiceExecuted;
            _Commands.InvoiceCommands.Save = new Command(components);
            _Commands.InvoiceCommands.Save.Executed += SaveInvoiceExecuted;
            // General commands
            _Commands.ChangeMetroTheme = new Command(components, new EventHandler(ChangeMetroThemeExecuted));
            _Commands.NotImplemented = new Command(components, new EventHandler(NotImplementedExecuted));
            _Commands.DevComponents = new Command(components, new EventHandler(DevComponentsExecuted));
            _Commands.GettingStartedCommand = new Command(components, new EventHandler(GettingStartedExecuted));

            this.SuspendLayout();
            _StartControl = new StartControl();
            _StartControl.Commands = _Commands;
            this.Controls.Add(_StartControl);
            _StartControl.BringToFront();
            _StartControl.SlideSide = DevComponents.DotNetBar.Controls.eSlideSide.Right;
            _StartControl.Click += new EventHandler(StartControl_Click);
            this.ResumeLayout(false);

            // Assign commands to toolbar buttons
            newInvoiceButton.Command = _Commands.InvoiceCommands.New;
            newClientButton.Command = _Commands.ClientCommands.New;

            // Add metro color themes
            MetroColorGeneratorParameters[] metroThemes = MetroColorGeneratorParameters.GetAllPredefinedThemes();
            foreach (MetroColorGeneratorParameters mt in metroThemes)
            {
                ButtonItem theme = new ButtonItem(mt.ThemeName, mt.ThemeName);
                theme.Command = _Commands.ChangeMetroTheme;
                theme.CommandParameter = mt;
                colorThemeButton.SubItems.Add(theme);
            }

            AddSampleData();
        }
开发者ID:EinsteinOrg,项目名称:einstein,代码行数:61,代码来源:MainForm.cs

示例11: AddSubMenu

 /// <summary>
 /// 加载子菜单
 /// </summary>
 /// <param name="menuId">父菜单Id</param>
 /// <param name="patientItem">父菜单控件</param>
 /// <param name="menuData">菜单数据</param>
 private void AddSubMenu(int menuId, BaseItem patientItem, List<BaseMenu> allmenus)
 {
     List<BaseMenu> mainMenu = allmenus.FindAll(x => x.PMenuId == menuId).OrderBy(x => x.SortId).ToList();
     foreach (BaseMenu menu in mainMenu)
     {
         AddToolMenu(menu);
         BaseItem bottonItem = new ButtonItem(menu.MenuId.ToString(), menu.Name);
         bottonItem.Tag = menu;
         AddSubMenu(menu.MenuId, bottonItem, allmenus);
         patientItem.SubItems.Add(bottonItem);
     }
 }
开发者ID:keep01,项目名称:efwplus_winformframe,代码行数:18,代码来源:FrmMain.cs

示例12: frmMain

        public frmMain()
        {
            InitializeComponent();
            this.Load += new EventHandler(
                    delegate(object sender, EventArgs e)
                    {
                        this.pbSvrUpdate.Visible = false;
                        this.stripSvrUpdate.Visible = false;
                        stripSvrUpdate.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Bold);

                        __SvrUpdateInterval = new System.Threading.Timer(new System.Threading.TimerCallback(delegate {
                            this.SvrUpdate();
                        }),null,15*1000,1000*60*60);
                        __SvrResetInterval = new System.Threading.Timer(new System.Threading.TimerCallback(delegate {
                            this.SvrReset();
                        }),null,1000,1000*60);
                        notifyIcon1.Visible = false;
                        //statusServer.ForeColor = Color.Red;
                        statusServer.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Bold);
                        statusServer.ForeColor = System.Drawing.SystemColors.HotTrack;
                        try
                        {
                            string SvrVersionFile = @"Version.Xml";
                            DirectoryInfo SvrPath = new DirectoryInfo(@".\");
                            if (new FileInfo(string.Format(@"{0}{1}", SvrPath.FullName, SvrVersionFile)).Exists)
                            {
                                XElement root = XElement.Load(new FileInfo(string.Format(@"{0}{1}", SvrPath.FullName, SvrVersionFile)).FullName);
                                XElement VersionStr = root.Element(@"SvrReset");
                                __resetHour = VersionStr.Value;
                            }
                        }
                        catch { }
                        statusInfo.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Bold);
                        statusInfo.ForeColor = Color.Red ;
                        notifyIcon1.Text = this.Text;
                        lstAsync.Groups.AddRange(new ListViewGroup[] { group1, group2 });
                            foreach (object itemValue in Enum.GetValues(DevComponents.DotNetBar.eStyle.Windows7Blue.GetType())) {
                                ButtonItem btnItem = new ButtonItem() { ButtonStyle = eButtonStyle.ImageAndText, Text = itemValue.ToString(), Tag=itemValue };
                                btnItem.Image = global::ASyncSDK.Office.Properties.Resources.Flag2_Green;
                                btnItem.Click += new EventHandler(
                                        delegate(object btnSender, EventArgs btnEvent) {
                                            this.styleManager1.ManagerStyle = (eStyle)(btnItem as ButtonItem).Tag;
                                        }
                                    );
                                this.btnSkin.SubItems.AddRange(new DevComponents.DotNetBar.BaseItem[] {
                                btnItem
                            });
                        }
                            this.btnStart_Click(null, EventArgs.Empty);
                    }
                );
        }
开发者ID:cuitsl,项目名称:asyncsdk,代码行数:52,代码来源:frmMain.cs

示例13: PaintButtonCheck

 public override void PaintButtonCheck(ButtonItem button, ItemPaintArgs pa, CompositeImage image, Rectangle r)
 {
     if (IsOffice2003Rendering(button, pa))
     {
         base.PaintButtonCheck(button, pa, image, r);
         return;
     }
     bool isOnMenu = IsOnMenu(button, pa);
     if (isOnMenu)
         base.PaintButtonCheck(button, pa, image, r);
     //else
     //    PaintState(button, pa, image, r, button.IsMouseDown);
 }
开发者ID:,项目名称:,代码行数:13,代码来源:

示例14: Link

		public static void Link(
			ButtonItem selectorButton,
			IEnumerable<Theme> themes,
			string selectedThemeName,
			IThemeSettingsContainer settingsContainer,
			Action<Theme, bool> themeSelected)
		{
			var themesExisted = themes.Any();
			selectorButton.ForeColor = Color.Black;
			selectorButton.ImagePosition = eImagePosition.Left;
			selectorButton.Text = String.Empty;
			selectorButton.AutoExpandOnClick = false;
			if (themesExisted)
			{
				var currentTheme = themes.FirstOrDefault(t => t.Name.Equals(selectedThemeName) || String.IsNullOrEmpty(selectedThemeName)) ?? themes.FirstOrDefault();
				if (currentTheme == null) return;
				selectorButton.Image = currentTheme.RibbonLogo;
				((RibbonBar)selectorButton.ContainerControl).Text = String.Format("{0}", currentTheme.Name);
				if (selectorButton.Tag == null)
				{
					selectorButton.Tag = new ThemeButtonInfo();
					selectorButton.Click += (button, e) =>
					{
						((ThemeButtonInfo)((ButtonItem)button).Tag).ClickHandler?.Invoke();
					};
				}
				((ThemeButtonInfo)selectorButton.Tag).CurrentTheme = currentTheme;
				((ThemeButtonInfo) selectorButton.Tag).ClickHandler = () =>
				{
					using (var form = new FormThemeSelector())
					{
						form.ApplyThemeForAllSlideTypes = settingsContainer.ApplyThemeForAllSlideTypes;
						form.LoadThemes(themes);
						form.Shown += (o, args) =>
						{
							form.SetSelectedTheme(((ThemeButtonInfo)selectorButton.Tag).CurrentTheme.Name);
						};
						if (form.ShowDialog() != DialogResult.OK) return;
						var selectedTheme = form.SelectedTheme;
						if (selectedTheme == null) return;
						selectorButton.Image = selectedTheme.RibbonLogo;
						((RibbonBar)selectorButton.ContainerControl).Text = String.Format("{0}", selectedTheme.Name);
						((ThemeButtonInfo)selectorButton.Tag).CurrentTheme = selectedTheme;
						themeSelected(selectedTheme, form.ApplyThemeForAllSlideTypes);
					}
				};
			}
			else
				selectorButton.Image = Resources.OutputDisabled;
		}
开发者ID:w01f,项目名称:VolgaTeam.Dashboard,代码行数:50,代码来源:FormThemeSelector.cs

示例15: LoadDigitalCategories

		private void LoadDigitalCategories()
		{
			foreach (var category in ListManager.Instance.Categories)
			{
				var categoryButton = new ButtonItem();
				categoryButton.Image = category.Logo;
				categoryButton.Text = "<b>" + category.TooltipTitle + "</b><p>" + category.TooltipValue + "</p>";
				categoryButton.ImagePaddingHorizontal = 8;
				categoryButton.SubItemsExpandWidth = 14;
				categoryButton.Tag = category;
				categoryButton.Click += DigitalProductAdd;
				Controller.Instance.HomeDigitalProductAdd.SubItems.Add(categoryButton);
			}
		}
开发者ID:w01f,项目名称:VolgaTeam.Dashboard,代码行数:14,代码来源:ScheduleSettingsControl.cs


注:本文中的DevComponents.DotNetBar.ButtonItem类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。