本文整理汇总了C#中System.Windows.Forms.RibbonButton类的典型用法代码示例。如果您正苦于以下问题:C# RibbonButton类的具体用法?C# RibbonButton怎么用?C# RibbonButton使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
RibbonButton类属于System.Windows.Forms命名空间,在下文中一共展示了RibbonButton类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: InitLists
private void InitLists()
{
Image[] images = new Image[255];
RibbonProfessionalRenderer rend = new RibbonProfessionalRenderer();
BackColor = Theme.ColorTable.RibbonBackground;
Random r = new Random();
#region Color Squares
using (GraphicsPath path = RibbonProfessionalRenderer.RoundRectangle(new Rectangle(3, 3, 26, 26), 4))
{
using (GraphicsPath outer = RibbonProfessionalRenderer.RoundRectangle(new Rectangle(0, 0, 32, 32), 4))
{
for (int i = 0; i < images.Length; i++)
{
Bitmap b = new Bitmap(32, 32);
using (Graphics g = Graphics.FromImage(b))
{
g.SmoothingMode = SmoothingMode.AntiAlias;
using (SolidBrush br = new SolidBrush(Color.FromArgb(255, i * (255 / images.Length), 0)))
{
g.FillPath(br, path);
}
using (Pen p = new Pen(Color.White, 3))
{
g.DrawPath(p, path);
}
g.DrawPath(Pens.Wheat, path);
g.DrawString(Convert.ToString(i + 1), Font, Brushes.White, new Point(10, 10));
}
images[i] = b;
RibbonButton btn = new RibbonButton();
btn.Image = b;
lst.Buttons.Add(btn);
}
}
}
//lst.DropDownItems.Add(new RibbonSeparator("Available styles"));
RibbonButtonList lst2 = new RibbonButtonList();
for (int i = 0; i < images.Length; i++)
{
RibbonButton btn = new RibbonButton();
btn.Image = images[i];
lst2.Buttons.Add(btn);
}
lst.DropDownItems.Add(lst2);
lst.DropDownItems.Add(new RibbonButton("Save selection as a new quick style..."));
lst.DropDownItems.Add(new RibbonButton("Erase Format"));
lst.DropDownItems.Add(new RibbonButton("Apply style..."));
#endregion
#region Theme Colors
RibbonButton[] buttons = new RibbonButton[30];
int square = 16;
int squares = 4;
int sqspace = 2;
for (int i = 0; i < buttons.Length; i++)
{
#region Create color squares
Bitmap colors = new Bitmap((square + sqspace) * squares, square + 1);
string[] colorss = new string[squares];
using (Graphics g = Graphics.FromImage(colors))
{
for (int j = 0; j < 4; j++)
{
Color sqcolor = GetRandomColor(r);
colorss[j] = sqcolor.Name;
using (SolidBrush b = new SolidBrush(sqcolor))
{
g.FillRectangle(b, new Rectangle(j * (square + sqspace), 0, square, square));
}
g.DrawRectangle(Pens.Gray, new Rectangle(j * (square + sqspace), 0, square, square));
}
}
#endregion
buttons[i] = new RibbonButton(colors);
buttons[i].Text = string.Join(", ", colorss); ;
buttons[i].MaxSizeMode = RibbonElementSizeMode.Medium;
buttons[i].MinSizeMode = RibbonElementSizeMode.Medium;
}
RibbonButtonList blst = new RibbonButtonList(buttons);
blst.FlowToBottom = false;
blst.ItemsSizeInDropwDownMode = new Size(1, 10);
itemColors.DropDownItems.Insert(0, blst);
itemColors.DropDownResizable = true;
#endregion
}
开发者ID:iraychen,项目名称:OfficeRibbon,代码行数:100,代码来源:MainForm.cs
示例17: ButtonCorners
/// <summary>
/// Gets the corners to round on the specified button
/// </summary>
/// <param name="r"></param>
/// <param name="button"></param>
/// <returns></returns>
private Corners ButtonCorners(RibbonButton button)
{
if (!(button.OwnerItem is RibbonItemGroup))
{
return Corners.All;
}
else
{
RibbonItemGroup g = button.OwnerItem as RibbonItemGroup;
Corners c = Corners.None;
if (button == g.FirstItem)
{
c |= Corners.West;
}
if (button == g.LastItem)
{
c |= Corners.East;
}
return c;
}
}
开发者ID:shintadono,项目名称:System.Windows.Forms.Ribbon,代码行数:29,代码来源:RibbonProfessionalRenderer.cs
示例18: InitializeComponent
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.ribbonBar = new Genetibase.UI.RibbonControl();
this.blankTab = new Genetibase.UI.RibbonTab();
this.actionsTab = new Genetibase.UI.RibbonTab();
this.fileButtonsGroup = new Genetibase.UI.RibbonGroup();
this.importButton = new Genetibase.UI.RibbonButton();
this.exportButton = new Genetibase.UI.RibbonButton();
this.openButton = new Genetibase.UI.RibbonButton();
this.saveButton = new Genetibase.UI.RibbonButton();
this.editButtonsGroup = new Genetibase.UI.RibbonGroup();
this.cutButton = new Genetibase.UI.RibbonButton();
this.copyButton = new Genetibase.UI.RibbonButton();
this.pasteButton = new Genetibase.UI.RibbonButton();
this.pasteAsButton = new Genetibase.UI.RibbonButton();
this.selectTab = new Genetibase.UI.RibbonTab();
this.selectButtonsGroup = new Genetibase.UI.RibbonGroup();
this.selectButton = new Genetibase.UI.RibbonButton();
this.curveButtonsGroup = new Genetibase.UI.RibbonGroup();
this.curvePointButton = new Genetibase.UI.RibbonButton();
this.segmentButton = new Genetibase.UI.RibbonButton();
this.pointMatchButton = new Genetibase.UI.RibbonButton();
this.curveCombo = new System.Windows.Forms.ComboBox();
this.measureButtonsGroup = new Genetibase.UI.RibbonGroup();
this.measureButton = new Genetibase.UI.RibbonButton();
this.measureCombo = new System.Windows.Forms.ComboBox();
this.scaleButtonsGroup = new Genetibase.UI.RibbonGroup();
this.axisButton = new Genetibase.UI.RibbonButton();
this.scaleButton = new Genetibase.UI.RibbonButton();
this.normalStatus = new System.Windows.Forms.StatusBarPanel();
this.permanentStatus = new System.Windows.Forms.StatusBarPanel();
this.resStatus = new System.Windows.Forms.StatusBarPanel();
this.coordsStatus = new System.Windows.Forms.StatusBarPanel();
this.statusBar = new Genetibase.NuGenTransform.NuGenStatusBar();
this.ribbonBar.SuspendLayout();
this.actionsTab.SuspendLayout();
this.fileButtonsGroup.SuspendLayout();
this.editButtonsGroup.SuspendLayout();
this.selectTab.SuspendLayout();
this.selectButtonsGroup.SuspendLayout();
this.curveButtonsGroup.SuspendLayout();
this.measureButtonsGroup.SuspendLayout();
this.scaleButtonsGroup.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.normalStatus)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.permanentStatus)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.resStatus)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.coordsStatus)).BeginInit();
this.SuspendLayout();
//
// ribbonBar
//
this.ribbonBar.Controls.Add(this.blankTab);
this.ribbonBar.Controls.Add(this.actionsTab);
this.ribbonBar.Controls.Add(this.selectTab);
this.ribbonBar.Dock = System.Windows.Forms.DockStyle.Top;
this.ribbonBar.Location = new System.Drawing.Point(0, 0);
this.ribbonBar.Name = "ribbonBar";
this.ribbonBar.SelectedIndex = 1;
this.ribbonBar.Size = new System.Drawing.Size(800, 116);
this.ribbonBar.TabIndex = 0;
this.ribbonBar.OnPopup += new Genetibase.UI.RibbonPopupEventHandler(this.ribbonBar_OnPopup);
//
// blankTab
//
this.blankTab.Location = new System.Drawing.Point(4, 25);
this.blankTab.Name = "blankTab";
this.blankTab.Size = new System.Drawing.Size(792, 87);
this.blankTab.TabIndex = 0;
this.blankTab.Text = "Menu";
//
// actionsTab
//
this.actionsTab.Controls.Add(this.fileButtonsGroup);
this.actionsTab.Controls.Add(this.editButtonsGroup);
this.actionsTab.Location = new System.Drawing.Point(4, 25);
this.actionsTab.Name = "actionsTab";
this.actionsTab.Padding = new System.Windows.Forms.Padding(3);
this.actionsTab.Size = new System.Drawing.Size(792, 87);
this.actionsTab.TabIndex = 0;
this.actionsTab.Text = "Actions";
this.actionsTab.UseVisualStyleBackColor = true;
//
// fileButtonsGroup
//
this.fileButtonsGroup.Controls.Add(this.importButton);
this.fileButtonsGroup.Controls.Add(this.exportButton);
this.fileButtonsGroup.Controls.Add(this.openButton);
this.fileButtonsGroup.Controls.Add(this.saveButton);
this.fileButtonsGroup.Location = new System.Drawing.Point(5, 5);
this.fileButtonsGroup.Margin = new System.Windows.Forms.Padding(1);
this.fileButtonsGroup.Name = "fileButtonsGroup";
this.fileButtonsGroup.Size = new System.Drawing.Size(280, 79);
this.fileButtonsGroup.TabIndex = 1;
this.fileButtonsGroup.TabStop = false;
this.fileButtonsGroup.Text = "File";
//
//.........这里部分代码省略.........
开发者ID:xuchuansheng,项目名称:GenXSource,代码行数:101,代码来源:NuGenForm.Designer.cs
示例19: DrawButtonDropDownArrow
/// <summary>
/// Draws the arrow of buttons
/// </summary>
/// <param name="g"></param>
/// <param name="button"></param>
public void DrawButtonDropDownArrow(Graphics g, RibbonButton button, Rectangle textLayout)
{
Rectangle bounds = Rectangle.Empty;
if (button.SizeMode == RibbonElementSizeMode.Large || button.SizeMode == RibbonElementSizeMode.Overflow)
{
bounds = LargeButtonDropDownArrowBounds(g, button.Owner.Font, button.Text, textLayout);
}
else
{
//bounds = new Rectangle(
// button.ButtonFaceBounds.Right + (button.DropDownBounds.Width - arrowSize.Width) / 2,
// button.Bounds.Top + (button.Bounds.Height - arrowSize.Height) / 2,
// arrowSize.Width, arrowSize.Height);
bounds = textLayout;
}
DrawArrowShaded(g, bounds, button.DropDownArrowDirection, button.Enabled);
}
开发者ID:shintadono,项目名称:System.Windows.Forms.Ribbon,代码行数:26,代码来源:RibbonProfessionalRenderer.cs
示例20: UpdateRecentPackFiles
public void UpdateRecentPackFiles()
{
RibbonItemCollection collection = mRibbon.OrbDropDown.RecentItems;
collection.Clear();
for (int i = 0; i < Settings.RecentPackFiles.Count; i++) {
RibbonButton item = new RibbonButton();
item.Text = PathShortener(Settings.RecentPackFiles[i], 40);
item.Tag = Settings.RecentPackFiles[i];
item.Click += new EventHandler(recentItem_Click);
collection.Add(item);
}
}
开发者ID:Megamatt01,项目名称:peggle-edit,代码行数:14,代码来源:MenuToolPanel.cs
注:本文中的System.Windows.Forms.RibbonButton类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论