DevExpress02、RibbonControl
RibbonControl
常用操作
1、如何代码显示选中的页
ribbonControl1.SelectedPage = ribbonPage2;
2、如何绑定ApplicationMenus和PopupMenu:
通过ribbonControl上的PopupContextMenu进行绑定;
如何代码创建RibbonContrl
效果如下:
代码如下:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
using DevExpress.XtraEditors; using DevExpress.XtraBars.Ribbon; using DevExpress.XtraBars; namespace DXApplication_1
{
public partial class RibbonCtrolForm2 : DevExpress.XtraEditors.XtraForm
{
public RibbonCtrolForm2()
{
InitializeComponent();
} private void RibbonCtrolForm2_Load(object sender, EventArgs e)
{
// Create a RibbonControl RibbonControl RibbonControl = new RibbonControl(); this.Controls.Add(RibbonControl); // Assign the image collection that will provide images for bar items. RibbonControl.Images = imageCollection1; // Create a Ribbon page.
RibbonPage page1 = new RibbonPage("Home"); // Create a Ribbon page group.
RibbonPageGroup group1 = new RibbonPageGroup("File");
// Create another Ribbon page group.
RibbonPageGroup group2 = new RibbonPageGroup("File 2"); // Create a button item using the CreateButton method.
// The created item is automatically added to the item collection of the RibbonControl.
BarButtonItem itemOpen = RibbonControl.Items.CreateButton("Open...");
itemOpen.ImageIndex = ;
itemOpen.ItemClick += new ItemClickEventHandler(itemOpen_ItemClick); // Create a button item using its constructor.
// The constructor automatically adds the created item to the RibbonControl's item collection.
BarButtonItem itemClose = new BarButtonItem(RibbonControl.Manager, "Close");
itemClose.ImageIndex = ;
itemClose.ItemClick += new ItemClickEventHandler(itemClose_ItemClick); // Create a button item using the default constructor.
BarButtonItem itemPrint = new BarButtonItem();
// Manually add the created item to the item collection of the RibbonControl.
RibbonControl.Items.Add(itemPrint);
itemPrint.Caption = "Search";
itemPrint.ImageIndex = ;
itemPrint.ItemClick += new ItemClickEventHandler(itemPrint_ItemClick); // Add the created items to the group using the AddRange method.
// This method will create bar item links for the items and then add the links to the group.
group1.ItemLinks.AddRange(new BarItem[] { itemOpen, itemClose, itemPrint });
// Add the Open bar item to the second group.
group2.ItemLinks.Add(itemOpen); // Add the created groups to the page.
page1.Groups.Add(group1);
page1.Groups.Add(group2); // Add the page to the RibbonControl.
RibbonControl.Pages.Add(page1);
} void itemPrint_ItemClick(object sender, ItemClickEventArgs e)
{
} void itemClose_ItemClick(object sender, ItemClickEventArgs e)
{
} void itemOpen_ItemClick(object sender, ItemClickEventArgs e)
{
}
}
}
DevExpress02、RibbonControl的更多相关文章
- WPF仿Word头部格式,涉及DEV RibbonControl,NarvbarControl,ContentPresenter,Navigation
时隔1个月,2015/06/17走进新的环境. 最近一个星期在学习仿Word菜单栏的WPF实现方式,废话不多说,先看一下效果. 打开界面后,默认选中[市场A],A对应的菜单栏,如上图, 选择[市场B] ...
- DevExpress中RibbonControl的简单应用
现在介绍一下DevExpress中的RibbonControl的简单应用,搭建一个拥有Office2010风格的窗体程序. 第一步:打开VS2015,新建一个windows窗体应用程序: 第二步:把需 ...
- XtraEditors四、TextEdit、ButtonEdit、PictureEdit、RadioGroup、PopupContainerEdit
TextEdit控件 以文本框的形式绑定各种形式的选择框: 文本框设置 输入 密码 字符 时, 要有 * 号掩盖输入的字符, 代码如下: textEdit1.Properties.PasswordCh ...
- DevExpress06、Popup Menus、RadialMenu、XtraTabControl、SplitContainerControl、GroupControl
Popup Menus 弹出菜单 使用弹出菜单(popup menus),我们可以在 控件上 显示 上下文选项 或 命令. 弹出菜单是一个显示了特定项的窗体,用户可以选择这些项以执行 ...
- DevExpress01:Bar Manager,bar 、Toolbars
Bar Manager : 不可见的控件 如果想在窗体或用户控件添加工具条或弹出菜单,我们需要把一个不可见的控件 BarManager拖放到这个窗体或用户控件上. 这个BarManager控件维护工具 ...
- js-静态、原型、实例属性
本篇来说一下js中的属性: 1.静态属性 2.原型属性 3.实例属性 静态属性: function klass(){} var obj=new klass(); klass.count=0; klas ...
- 【.net 深呼吸】细说CodeDom(2):表达式、语句
在上一篇文章中,老周厚着脸皮给大伙介绍了代码文档的基本结构,以及一些代码对象与CodeDom类型的对应关系. 在评论中老周看到有朋友提到了 Emit,那老周就顺便提一下.严格上说,Emit并不是针对代 ...
- javascript中的Array对象 —— 数组的合并、转换、迭代、排序、堆栈
Array 是javascript中经常用到的数据类型.javascript 的数组其他语言中数组的最大的区别是其每个数组项都可以保存任何类型的数据.本文主要讨论javascript中数组的声明.转换 ...
- IE6、7下html标签间存在空白符,导致渲染后占用多余空白位置的原因及解决方法
直接上图:原因:该div包含的内容是靠后台进行print操作,输出的.如果没有输出任何内容,浏览器会默认给该空白区域添加空白符.在IE6.7下,浏览器解析渲染时,会认为空白符也是占位置的,默认其具有字 ...
随机推荐
- webpack3+node+react+babel实现热加载(hmr)
前端工程化开发的一个重要标志就是热替换技术,它大大的提高开发效率,使我们专注于写代码,webpack3中的热替换相比较1更加简洁. 1. 先看效果 Demo地址 https://github.com/ ...
- [转]UTF-8 encoding support for the BCP utility and BULK INSERT Transact-SQL command in SQL Server 2014 SP2
本文转自:https://support.microsoft.com/en-us/help/3136780/utf-8-encoding-support-for-the-bcp-utility-and ...
- Jade——变体的HTML
什么是jade? jade是一个模板引擎,是变体的HTML. 模板引擎就是一个库,用来解释素具渲染视图的框架,也可以叫做HTML的预处理语言. jade是Node.js的一个模板引擎,他的语法借鉴了H ...
- C#将Dll嵌入到EXE
感谢博主的方法: https://blog.csdn.net/lin381825673/article/details/39122257 我之前也看了网上的其他的方法试了都不行 第一种方法就是说用IL ...
- js,需要更多源字符
里面有的括号没写完 没有关闭 使整个js都不能用 vs2010安装个下面JS插件,更好的分层, https://marketplace.visualstudio.com/items?itemNam ...
- Ubuntu下NAT模式配置静态IP
编辑文件/etc/network/interfaces: 并用下面的行来替换有关eno16777736的行: # The primary network interfaceauto eno167777 ...
- 二十、curator recipes之NodeCache
简介 Curator的NodeCache允许你监听一个节点,当节点数据更改或者节点被删除的时候将会触发监听. 官方文档:http://curator.apache.org/curator-recipe ...
- 15、springboot访问html文件
在pom.xml加入 <parent> <groupId>org.springframework.boot</groupId> <artifactId> ...
- 为什么不要 "lock(this)" ? lock object 并是readonly(转载)
一. 为什么要lock,lock了什么? 当我们使用线程的时候,效率最高的方式当然是异步,即各个线程同时运行,其间不相互依赖和等待.但当不同的线程都需要访问某个资源的时候,就需要同步机制了,也就是 ...
- Git 学习之Git 基础(二)
Git 基础 读完本章你就能上手使用 Git 了.本章将介绍几个最基本的,也是最常用的 Git 命令,以后绝大多数时间里用到的也就是这几个命令.读完本章,你就能初始化一个新的代码仓库,做一些适当配置: ...