本文整理汇总了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);
}
示例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");
}
示例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;
}
示例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
}
示例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;
}
示例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;
}
示例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);
}
示例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;
}
示例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)
{
}
示例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);
}
示例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;
}
}
示例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));
}
示例13: RibbonButtonRenderEventArgs
public RibbonButtonRenderEventArgs(Ribbon owner, Graphics g, Rectangle clip, RibbonButton button)
: base(owner, g, clip)
{
Button = button;
}
示例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);
}
示例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);
}