1.TextEditor(barEditItem)取文本

string editValue = barEditItem1.EditValue.ToString();    //错误,返回null
 
string editValue = ((DevExpress.XtraEditors.TextEdit)barEditItem).EditValue.ToString();    //精确,返回文本框内容 DevExpress使用技巧

2.ComboBoxEdit(barEditItem)添加Item

string item = "comboboxItem1";
((DevExpress.XtraEditors.Repository.RepositoryItemComboBox)this.barEditItem.Edit).Items.Add(item);

3.ComboBoxEdit(barEditItem)取文本

string itemValue = this.barEditItem.EditValue.ToString();

4.Ribbon控件

//添加Page
DevExpress.XtraBars.Ribbon.RibbonPage ribbonPage = new RibbonPage();
ribbonControl.Pages.Add(ribbonPage);
//添加Group
DevExpress.XtraBars.Ribbon.RibbonPageGroup ribbonPageGroup = new RibbonPageGroup();
ribbonPage.Groups.Add(ribbonPageGroup);
//添加Button
DevExpress.XtraBars.BarButtonItem barButtonItem = new BarButtonItem();
ribbonPageGroup.ItemLinks.Add(barButtonItem);
//添加barSubItem
DevExpress.XtraBars.BarSubItem barSubItem = new BarSubItem();
ribbonPageGroup.ItemLinks.Add(barSubItem);
//barSubItem下添加Button
barSubItem.AddItem(barButtonItem);
 
 
//奇异的删除Page问题( DevExpress使用技巧)
while (this.ribbonControl.Pages.Count > 0)
{
     ribbonControl.Pages.Remove(ribbonControl.Pages[0]);    //调试正常,运转报异常
}
while (this.ribbonControl.Pages.Count > 0)
{
     ribbonControl.SelectedPage = ribbonControl.Pages[0];
     ribbonControl.Pages.Remove(ribbonControl.SelectedPage); //运转正常
}
//遏止F10键Tips (DevExpress使用技巧)
ribbonControl.Manager.UseF10KeyForMenu = false;
//DX按钮
ApplicationIcon属性改动图标
右键 Add ApplicationMenu 添加evExpress.XtraBars.Ribbon.ApplicationMenu5.HitInfo

//在Tab页上点击右键的工作响应(DevExpress使用技巧)
void xtraTabbedMdiManager_Event(object sender, MouseEventArgs e)
{
     if (e.Button == MouseButtons.Right && ActiveMdiChild != null)
     {
          DevExpress.XtraTab.ViewInfo.BaseTabHitInfo hInfo = xtraTabbedMdiManager.CalcHitInfo(e.Location);
          //右键点击位置:在Page上且不在封闭按钮内
          if (hInfo.IsValid && hInfo.Page != null && !hInfo.InPageCloseButton)
          {
               this.popupMenu.ShowPopup(Control.MousePosition);//在鼠标位置弹出,而不是e.Location
          }
     }
}
//在ribbon上点击右键的工作响应
private void ribbonControl1_ShowCustomizationMenu(object sender, RibbonCustomizationMenuEventArgs e)
{
    //禁掉原系统右键菜单
    e.ShowCustomizationMenu = false;
    //右键位置:在barButtonItem上
    if (e.HitInfo != null
     && e.HitInfo.InItem
     && e.HitInfo.Item.Item is BarButtonItem)
    {
         this.popupMenu.ShowPopup(Control.MousePosition);
    }
    //右键位置:在barSubItem中的barButtonItem上
    else if (e.Link != null
          && e.Link.Item != null
          && e.Link.Item is BarButtonItem)
    {
         this.popupMenu.ShowPopup(Control.MousePosition);
    }
}

6.皮肤

//添加皮肤轨范集后注册皮肤( DevExpress使用技巧)
DevExpress.UserSkins.OfficeSkins.Register();
DevExpress.UserSkins.BonusSkins.Register();
//设置皮肤
DevExpress.LookAndFeel.UserLookAndFeel.Default.SetSkinStyle("Liquid Sky");    //若皮肤称号错误则按系统默许设置(第一个皮肤)
//GalleryFilterMenuPopup工作设置弹出选择菜单的“All Groups”为中文
private void rgbiSkins_GalleryFilterMenuPopup(object sender, GalleryFilterMenuEventArgs e)
{
    e.FilterMenu.ItemLinks[n].Caption = "一切皮肤";    //n=分组数+1
}
//GalleryInitDropDownGallery工作设置弹出皮肤列表的表头“ALL Groups”为中文
private void rgbiSkins_GalleryInitDropDownGallery(object sender, InplaceGalleryEventArgs e)
{
    e.PopupGallery.FilterCaption = "一切皮肤";
}

7.dockManager

将视图的状况信息保管到xml文件
dockManager1.SaveLayoutToXml("..\\UserConfig\\ViewInfo.xml");
导出xml中保管的状况信息
dockManager1.RestoreLayoutFromXml("..\\UserConfig\\ViewInfo.xml");

8.barManager

设置bar的字体与系统字体
barAndDockingController1.AppearancesBar.ItemsFont = new Font(this.Font.FontFamily, currentFontSize);

9.设置系统字体

DevExpress.Utils.AppearanceObject.DefaultFont = new Font(this.Font.FontFamily, currentFontSize);

10.treeView

为tree节点加右键菜单并选中该节点
        private void treeList1_MouseDown(object sender, MouseEventArgs e)
        {
            if (e.Button == MouseButtons.Right)
            {
                DevExpress.XtraTreeList.TreeListHitInfo hi = treeList1.CalcHitInfo(e.Location);
                if (hi.Node != null && hi.Node.ImageIndex == 5) //叶子节点的ImageIndex == 5
                {
                    TreeListNode node = treeList1.FindNodeByID(hi.Node.Id);
                    treeList1.FocusedNode = node;
 
                    this.popupMenu1.ShowPopup(MousePosition);
                }
            }
        }
  ---------------------------------------------------

DevExpress z的更多相关文章

  1. 【Python】使用torrentParser1.03对多文件torrent的分析结果

    Your environment has been set up for using Node.js 8.5.0 (x64) and npm. C:\Users\horn1>cd C:\User ...

  2. Devexpress GridControl z

    http://minmin86121.blog.163.com/blog/static/4968115720144194923578/ 1 AllowNullInput=False; --Devexp ...

  3. DevExpress控件汉化类 z

    更新了一些字段,VER9.3.3 using System; using DevExpress.XtraEditors.Controls; using DevExpress.XtraGrid.Loca ...

  4. DevExpress TreeList 全选和反选 z

    /// <summary> /// 全选树 /// </summary> /// <param name="tree">树控件</para ...

  5. DevExpress打印功能 z

    一.打印功能说明: 打印功能,我们有多种实现方式,可以根据需要自行选择,我简单的总结下两种方法. (1).使用微软.net框架自带的PrintDocument,这种方式是直接借助Graphics,自行 ...

  6. DevExpress 14.2.3源码编译 z

    一.准备 1.准备一台Windows 8.1机器,安装VS2013 2.准备一台Windows 8.1机器,安装VS2010    XP的系统肯定不行,因为有不少的运行库不支持     Windows ...

  7. DevExpress licenses.licx 的解决方法 z

    在 使用DevExpress控件的时候.每次对窗体进行更改的时候,都会出现一个对话框.发布的时候 也会出现一个对话框.之前的解决方法是在发布的时候把licenses.licx给删除掉,但是这个方法治标 ...

  8. Winform之SpreadSheetGear转DevExpress.XtraSpreadsheet.v13.2 z

    DevExpress.XtraSpreadsheet.v13.2 允许用户创建.管理.打印.转换spreadsheet文件而不需要用户安装Office. 什么是Spreadsheet 可以看到最后就是 ...

  9. Winform使用DevExpress的WaitDialogForm画面 z

    使用了DevExpress的WaitDialogForm 在应用程序加载开始时新建一个线程,并将loading画面show起来,在应用程序画面弹出前将该线程终止. 代码: private DevExp ...

随机推荐

  1. Ubuntu环境下手动配置HBase0.94.25

    /×××××××××××××××××××××××××××××××××××××××××/ Author:xxx0624 HomePage:http://www.cnblogs.com/xxx0624/ ...

  2. 枚举桌面应用程序lnk路径并得到对应程序的绝对路径(使用SHGetDesktopFolder函数枚举,然后使用COM查询IShellFolder,IShellLink和IPersistFile接口)

    // 枚举桌面上应用程序的lnk路径 void EnumDesktopLnkPath() { WCHAR szPath[MAX_PATH] = {0}; SHGetSpecialFolderPathW ...

  3. 核心思想:百度网盘怎么盈利(互联网的高速更新决定了:亏钱你还有点机会,放弃连门都进不了),战略预备队 good

    百度做网盘很大程度就是为了防止别人依靠网盘做大和积累点技术储备.腾讯邮箱怎么赚钱?腾讯影音怎么赚钱?互联网的高速更新决定了,一些你看不起眼的软件很可能就会席卷整个市场,所以互联网大佬宁愿一些项目亏钱也 ...

  4. JAVA+ Proxool+ SQLserver 2008 “signer information does not match signer information of other classes in the same package”

    1. Proxool+SQLserver2008(sqljdbc4.jar)集成问题最近在项目中遇到个问题:我用的是Proxool连接池,连接SQLserver2008数据库,控制台报错:签名信息和同 ...

  5. apk反编译(2)smali语言及文件

    Smali语言是Davlik的虚拟机使用的一种语言,用toolapk反编译apk后,可以见到大量的.smali文件. 可以按照smali语法对其修改,然后重新生成一个未签名的apk. 下面是一个示例: ...

  6. [POJ1753]Flip Game(开关问题,枚举)

    题目链接:http://poj.org/problem?id=1753 和上一个题一样,将初始状态存成01矩阵,就可以用位运算优化了.黑色白色各来一遍 /* ━━━━━┒ギリギリ♂ eye! ┓┏┓┏ ...

  7. jquery select操作和联动操作

    (function(){ //select操作 $.fn.loadSelect = function(opt){ opt = $.extend({}, { required:false,//为真则添加 ...

  8. 1033. Labyrinth(dfs)

    1033 简单dfs 有一点小小的坑 就是图可能不连通 所以要从左上和右下都搜一下 加起来 从讨论里看到的 讨论里看到一句好无奈的回复 “可不可以用中文呀...” #include <iostr ...

  9. tornado中使用torndb,连接数过高的问题

    问题背景 最近新的产品开发中,使用了到了Tornado和mysql数据库.但在基本框架完成之后,我在开发时候发现了一个很奇怪的现象,我在测试时,发现数据库返回不了结果,于是我在mysql中输入show ...

  10. UVa 1153 Keep the Customer Satisfied 【贪心 优先队列】

    题意:给出n个工作,已知每个工作需要的时间last,以及截止时间end,(必须在截止时间之前完成)问最多能够完成多少个工作 首先预处理,将这n件任务按照截止时间从小到大排序 然后用一个cur记录当前做 ...