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. 【好玩的应用】QQ连连看辅助工具

    自己学了这么久的C语言,但没有写出过什么可以用的东西来,总觉得心里不爽.这几天实在是不想干正事,在网上瞎逛逛,结果发现有人写了连连看的外挂.顿时觉得这很有意思啊.于是把代码下载下来,捣鼓了捣鼓.发现还 ...

  2. POJ 1663

    #include<iostream>//cheng da cai zi using namespace std; int main() { int time; cin>>tim ...

  3. Android多媒体框架对音乐播放器的支持

    下面介绍一下Andriod多媒体框架对开发者提供的支持有哪些.               1. MediaScannerReceiver                   这个广播接收者在接收到A ...

  4. 利用hadoop自带程序运行wordcount

    1.启动hadoop守护进程 bin/start-all.sh 2.在hadoop的bin目录下建立一个input文件夹 JIAS-MacBook-Pro:hadoop- jia$ mkdir inp ...

  5. 各种实用的js,bootstrap插件

    1.nivoSlider  非常优秀的Banner轮播插件 2.BootstrapTable 表格插件使用技巧 = http://www.cnblogs.com/landeanfen/p/497683 ...

  6. lintcode :前序遍历和中序遍历树构造二叉树

    解题 前序遍历和中序遍历树构造二叉树 根据前序遍历和中序遍历树构造二叉树. 样例 给出中序遍历:[1,2,3]和前序遍历:[2,1,3]. 返回如下的树: 2 / \ 1 3 注意 你可以假设树中不存 ...

  7. 国内为什么没有好的 Stack Overflow 的模仿者?

    国内为什么没有好的 Stack Overflow 的模仿者? 个人觉得, 高端的程序员会直接上stackoverflow提问, 所以国内中文的stackoverflow必然面对低端程序员. 鉴于中国程 ...

  8. Hello World---C/C++

    C #include <stdio.h> void main() { printf("Hello World!\n"); } C++ #include <iost ...

  9. HTML5 文件API(二)

    1.FileSystem概述及浏览器检 2.申请磁盘配额 3.创建文件

  10. Photoshop:模拟钢笔压力

    预期效果: 方法: 按B选择画笔工具,设置"钢笔压力" 路径描边:选择路径,右击路径,选择“描边路径” 或在路径面板,选择: 即可得到预期效果!