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


C# Forms.RibbonButton类代码示例

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


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

示例1: Add

        /// <summary>
        /// Adds the specified item to the collection
        /// </summary>
        public new void Add(RibbonButton item)
        {
            CheckRestrictions(item as RibbonButton);

            item.SetOwner(Owner);
            item.SetOwnerPanel(OwnerPanel);
            item.SetOwnerTab(OwnerTab);

            base.Add(item);
        }
开发者ID:okyereadugyamfi,项目名称:softlogik,代码行数:13,代码来源:RibbonButtonCollection.cs

示例2: CheckRestrictions

        /// <summary>
        /// Checks for the restrictions that buttons should have on the RibbonButton List
        /// </summary>
        /// <param name="button"></param>
        private void CheckRestrictions(RibbonButton button)
        {
            if (button == null)
                throw new ApplicationException("The RibbonButtonList only accepts button in the Buttons collection");

            //if (!string.IsNullOrEmpty(button.Text))
            //    throw new ApplicationException("The buttons on the RibbonButtonList should have no text");

            if (button.Style != RibbonButtonStyle.Normal)
                throw new ApplicationException("The only style supported by the RibbonButtonList is Normal");
        }
开发者ID:shintadono,项目名称:System.Windows.Forms.Ribbon,代码行数:15,代码来源:RibbonButtonCollection.cs

示例3: ModuleRibbonGroup

        public override Microsoft.Office.Tools.Ribbon.RibbonGroup ModuleRibbonGroup(RibbonBase MyRibbon, RibbonTab MyRibbonTab)
        {
            RibbonGroup rGroup = MyRibbon.Factory.CreateRibbonGroup();
            rGroup.Name = this.Name;
            rGroup.Label = this.Label;

            exportButton = MyRibbon.Factory.CreateRibbonButton();
            exportButton.Name = "ExportButton";
            exportButton.Label = "Exportbutton";

            rGroup.Items.Add(exportButton);
            return rGroup;
        }
开发者ID:PSDevGithub,项目名称:PSExcelAddin2010,代码行数:13,代码来源:ExportToCSVModulecs.cs

示例4: toggleQuickAccessButton

 public void toggleQuickAccessButton(RibbonButton dropDownButton, RibbonButton quickAccessButton)
 {
     if (quickAccessButton.Visible)
     {
         dropDownButton.SmallImage = global::RibbonDemo.Properties.Resources.unchecked16;
         quickAccessButton.Visible = false;
     }
     else
     {
         dropDownButton.SmallImage = global::RibbonDemo.Properties.Resources.exit16;
         quickAccessButton.Visible = true;
     } // if / else
 }
开发者ID:amoikevin,项目名称:Office-Ribbon-Project,代码行数:13,代码来源:MainForm.cs

示例5: ModuleRibbonGroup

        //modulhoz ribbon group létrehozása
        public override RibbonGroup ModuleRibbonGroup(RibbonBase MyRibbon, RibbonTab MyRibbonTab)
        {
            RibbonGroup myGroup = MyRibbon.Factory.CreateRibbonGroup();
            myGroup.Name = this.Name;
            myGroup.Label = this.Label;

            testButton = MyRibbon.Factory.CreateRibbonButton();
            testButton.Name = "tesztGomb";
            testButton.Label = "Teszt";

            myGroup.Items.Add(testButton);
            return myGroup;
        }
开发者ID:PSDevGithub,项目名称:PSExcelAddin2010,代码行数:14,代码来源:TestModule.cs

示例6: RibbonQuickAccessToolbar

        internal RibbonQuickAccessToolbar(Ribbon ownerRibbon)
        {
            if (ownerRibbon == null) throw new ArgumentNullException("ownerRibbon");

             SetOwner(ownerRibbon);

             _dropDownButton = new RibbonButton();
             _dropDownButton.SetOwner(ownerRibbon);
             _dropDownButton.SmallImage = CreateDropDownButtonImage();

             _margin = new Padding(9);
             _padding = new Padding(3, 0, 0, 0);
             _items = new RibbonQuickAccessToolbarItemCollection(this);
             _sensor = new RibbonMouseSensor(ownerRibbon, ownerRibbon, Items);
             _DropDownButtonVisible = true;
        }
开发者ID:JamesMasterman,项目名称:SeaScan,代码行数:16,代码来源:RibbonQuickAccessToolbar.cs

示例7: AddRibbonButton

        public static void AddRibbonButton(Ribbon ribbon, 
                                           string tabText, 
                                           string buttonName,
                                           string text, 
                                           Image image, 
                                           string tooltip, 
                                           bool enable, 
                                           bool isChecked,
                                           RibbonButtonAlignment alignment,
                                           EventHandler clickHandler)
        {
            if (ribbon == null)
            {
                return;
            }

            RibbonItem ribbonItem = null;

            if (RibbonModulePluginProvider.Ribbon_Separator.Equals(buttonName))
            {
                ribbonItem = new RibbonSeparator();
            }
            else
            {
                ribbonItem = new RibbonButton();
                ribbonItem.Text = text;
                ribbonItem.Image = image;
                ribbonItem.ToolTip = tooltip;
                ribbonItem.Enabled = enable;
                ribbonItem.Checked = isChecked;
                ribbonItem.Click += new EventHandler(clickHandler);
            }

            ribbonItem.Name = buttonName;

            RibbonTab ribbonTab = RibbonHelper.FindRibbonTab(ribbon, tabText);

            if (ribbonTab == null)
            {
                return;
            }

            int panelIndex = alignment == RibbonButtonAlignment.Right ? 1 : 0;

            ribbonTab.Panels[panelIndex].Items.Add(ribbonItem);
        }
开发者ID:daywrite,项目名称:EApp,代码行数:46,代码来源:RibbonExtensionHelper.cs

示例8: roomclient

        /// <summary>
        /// Cập nhật thành viên trong phòng phía client
        /// </summary>
        /// <param name="name"></param>
        public void roomclient(string name)
        {
            RibbonButton button = new RibbonButton();
            button.Text = name;

            button.MaxSizeMode = System.Windows.Forms.RibbonElementSizeMode.Medium;
            button.MinSizeMode = System.Windows.Forms.RibbonElementSizeMode.Medium;
            _myMember.Add(button);
            rbpnl_RoomClient.Items.Add(button);
            rbbtn_Connect.Enabled = false;
        }
开发者ID:uynguyen,项目名称:MyCollaborativePainting,代码行数:15,代码来源:MyPaint.cs

示例9: DrawSplitButtonDropDownPressed

 /// <summary>
 /// Draws a SplitDropDown button with the dropdown area pressed
 /// </summary>
 /// <param name="e"></param>
 /// <param name="button"></param>
 public void DrawSplitButtonDropDownPressed(RibbonItemRenderEventArgs e, RibbonButton button)
 {
 }
开发者ID:shintadono,项目名称:System.Windows.Forms.Ribbon,代码行数:8,代码来源:RibbonProfessionalRenderer.cs

示例10: DrawButtonSelected

 /// <summary>
 /// Draws the button as a selected button
 /// </summary>
 /// <param name="g"></param>
 /// <param name="button"></param>
 public void DrawButtonSelected(Graphics g, RibbonButton button, Ribbon ribbon)
 {
     DrawButtonSelected(g, button.Bounds, ButtonCorners(button), ribbon);
 }
开发者ID:shintadono,项目名称:System.Windows.Forms.Ribbon,代码行数:9,代码来源:RibbonProfessionalRenderer.cs

示例11: ButtonDdRounding

        /// <summary>
        /// Determines button's dropDown corners
        /// </summary>
        /// <param name="button"></param>
        /// <returns></returns>
        private Corners ButtonDdRounding(RibbonButton button)
        {
            if (!(button.OwnerItem is RibbonItemGroup))
            {
                if (button.SizeMode == RibbonElementSizeMode.Large)
                {
                    return Corners.South;
                }
                else
                {
                    return Corners.East;
                }
            }
            else
            {
                Corners c = Corners.None;
                RibbonItemGroup g = button.OwnerItem as RibbonItemGroup;
                if (button == g.LastItem)
                {
                    c |= Corners.East;
                }

                return c;
            }
        }
开发者ID:shintadono,项目名称:System.Windows.Forms.Ribbon,代码行数:30,代码来源:RibbonProfessionalRenderer.cs

示例12: DrawButtonPressed

 /// <summary>
 /// Draws the button as pressed
 /// </summary>
 /// <param name="g"></param>
 /// <param name="button"></param>
 public void DrawButtonPressed(Graphics g, RibbonButton button)
 {
     DrawButtonPressed(g, button.Bounds, ButtonCorners(button));
 }
开发者ID:JoeyScarr,项目名称:word-commandmap,代码行数:9,代码来源:RibbonProfessionalRenderer.cs

示例13: RibbonButtonRenderEventArgs

 public RibbonButtonRenderEventArgs(Ribbon owner, Graphics g, Rectangle clip, RibbonButton button)
     : base(owner, g, clip)
 {
     Button = button;
 }
开发者ID:taozhengbo,项目名称:sdrsharp_experimental,代码行数:5,代码来源:RibbonButtonRenderEventArgs.cs

示例14: InitViewTab

		private void InitViewTab()
		{
			chkBackground = new RibbonCheckBox("Background");
			chkBackground.Checked = true;
			chkBackground.CheckedChanged += new EventHandler(showBackgroundRibbonButton_Click);

			chkInterface = new RibbonCheckBox("Interface");
			chkInterface.Checked = true;
			chkInterface.CheckedChanged += new EventHandler(showInterfaceRibbonButton_Click);

			chkObjects = new RibbonCheckBox("Objects");
			chkObjects.Checked = true;
			chkObjects.CheckedChanged += new EventHandler(showPegsRibbonButton_Click);

			chkCollision = new RibbonCheckBox("Collision");
			chkCollision.CheckedChanged += new EventHandler(showCollisionRibbonButton_Click);

			chkPreview = new RibbonCheckBox("Preview");
			chkPreview.CheckedChanged += new EventHandler(showPreviewRibbonButton_Click);

			RibbonPanel panelShowHide = new RibbonPanel("Show / Hide");
			panelShowHide.Items.Add(chkBackground);
			panelShowHide.Items.Add(chkInterface);
			panelShowHide.Items.Add(chkObjects);
			panelShowHide.Items.Add(chkCollision);
			panelShowHide.Items.Add(chkPreview);

			RibbonButton btnPackExplorer = new RibbonButton("Pack Explorer");
			btnPackExplorer.Image = Resources.pack_explorer_32;
			btnPackExplorer.Click += new EventHandler(packExplorerRibbonButton_Click);

			RibbonButton btnProperties = new RibbonButton("Properties");
			btnProperties.Image = Resources.properties_32;
			btnProperties.Click += new EventHandler(propertiesRibbonButton_Click);

			RibbonButton btnEntryList = new RibbonButton("Entry List");
			btnEntryList.Image = Resources.properties_32;
			btnEntryList.Click += new EventHandler(entryListRibbonButton_Click);

			RibbonPanel panelWindow = new RibbonPanel("Window");
			panelWindow.Items.Add(btnPackExplorer);
			panelWindow.Items.Add(btnProperties);
			panelWindow.Items.Add(btnEntryList);

			RibbonTab tabView = new RibbonTab(mRibbon, "View");
			tabView.Panels.Add(panelShowHide);
			tabView.Panels.Add(panelWindow);
			mRibbon.Tabs.Add(tabView);
		}
开发者ID:Megamatt01,项目名称:peggle-edit,代码行数:49,代码来源:MenuToolPanel.cs

示例15: InitHelpTab

		private void InitHelpTab()
		{
			RibbonButton btnReadme = new RibbonButton("Readme.txt");
			btnReadme.Image = Resources.readme_32;
			btnReadme.Click += new EventHandler(readmeRibbonButton_Click);

			RibbonButton btnAbout = new RibbonButton("About");
			btnAbout.Image = Resources.orca_32;
			btnAbout.Click += new EventHandler(aboutRibbonButton_Click);

			RibbonPanel panelHelp = new RibbonPanel();
			panelHelp.Items.Add(btnReadme);
			panelHelp.Items.Add(btnAbout);

			RibbonTab tabHelp = new RibbonTab(mRibbon, "Help");
			tabHelp.Panels.Add(panelHelp);
			mRibbon.Tabs.Add(tabHelp);
		}
开发者ID:Megamatt01,项目名称:peggle-edit,代码行数:18,代码来源:MenuToolPanel.cs


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