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. linux 查看局域网内ip

    $ sudo apt-get install nmap $ nmap -sP 192.168.1.1/24 windows 下直接arp -a就能看到.

  2. *[topcoder]LongWordsDiv2

    http://community.topcoder.com/stat?c=problem_statement&pm=13147 此题关键在于发现ABAB的组合最多有26*26种,可以穷举,然后 ...

  3. 【nginx运维基础(3)】Nginx的编译PHP

    Apache默认是把PHP作为本身的一个模块(mod_php)来运行的,而Nginx是以FastCGI方式运行的.所以使用Nginx+PHP就是直接配置为FastCGI模式. 安装PHP 下载地址: ...

  4. 什么是spring?

    一.对spring的理解. 1.Spring是实现了工厂模式的工厂类(什么是工厂类?简单的来说就是把需要的接口定义到一个类中,需要的时候不用新建,直接从这个类中调用该接口就可以了), 这个类的名字为B ...

  5. Sina App Engine(SAE)入门教程(7)- Storage使用

    参考阅读 sae storage api 文档 Storage 说明文档 Storage 大文件上传说明 storage是什么? 因为sae禁用了代码环境的本地读写,但是在网站运行的过程中,必定会出现 ...

  6. 无法嵌入互操作类型“ESRI.ArcGIS.Display.SimpleFillSymbolClass”。请改用适用的接口。

    无法嵌入互操作类型"ESRI.ArcGIS.Display.SimpleFillSymbolClass".请改用适用的接口. 对于这样的问题 先看这个错误所对应的引用时那个,比如这 ...

  7. PCL—低层次视觉—点云分割(基于凹凸性)

    1.图像分割的两条思路 场景分割时机器视觉中的重要任务,尤其对家庭机器人而言,优秀的场景分割算法是实现复杂功能的基础.但是大家搞了几十年也还没搞定——不是我说的,是接下来要介绍的这篇论文说的.图像分割 ...

  8. 如何构建你自己的Java库【翻译】

    原文http://www.programcreek.com/2011/07/build-a-java-library-for-yourself/ 原文和翻译都只是参考,如有不对,欢迎指正. 代码复用是 ...

  9. PHP比你想象的好得多

    有很多对于PHP的抱怨,甚至这些抱怨也出自很多聪明的人.当Jeff Atwood写下对于PHP的另一篇抱怨文章之后,我思考了下PHP的好的方面. 这些抱怨最大的问题是他们出自很多仍在使用旧版本PHP的 ...

  10. 使用 Oracle GoldenGate 在 Microsoft SQL Server 和 Oracle Database 之间复制事务

    使用 Oracle GoldenGate 在 Microsoft SQL Server 和 Oracle Database 之间复制事务 作者:Nikolay Manchev 分步构建一个跨这些平台的 ...