DevExpress Ribbongallerybaritem选择性皮肤重组

void InitSkinGallery()
 (系统自带的初始化皮肤方法,只需复制替换方法即可)      
{

SkinHelper skinHelper = new
SkinHelper();            
RibbonControl masterRibbonControl = new RibbonControl();

RibbonGalleryBarItem tempRibbonGalleryItem = new RibbonGalleryBarItem(new
BarManager());            
//  masterRibbonControl.ApplicationButtonDropDownControl =
tempRibbonGalleryItem;
           
SkinHelper.InitSkinGallery(tempRibbonGalleryItem);   //初始化各种控件皮肤的方法
           
SkinHelper.InitSkinGallery(ribbonGalleryBarItem1);
           
//customRibbonGrallery.Gallery.Groups.RemoveAt(1);
           
//customRibbonGrallery.Gallery.Groups.RemoveAt(2);

GalleryItemGroupCollection Collection = tempRibbonGalleryItem.Gallery.Groups;
           
//MessageBox.Show(Collection.Capacity.ToString());
            int TempIndex
= 0;

GalleryItemGroup SkinGroup = new GalleryItemGroup();

foreach
(GalleryItemGroup singleItemGroup in Collection)
            {
               
TempIndex++;

for (int i = 0; i < singleItemGroup.Items.Count; i++)
               
{
                   
GalleryItem item = singleItemGroup.Items[i];

// GalleryItem itemx = new GalleryItem();

//  itemx.Caption = "";
                   
if (TempIndex == 1)
                   
{
                       
if (i == 0 || i == 5)
                       
{
                           
//textEdit1.Text = textEdit1.Text + "|" + item.Caption;
                           
SkinGroup.Items.Add(item);
                       
}
                   
}
                   
else if (TempIndex == 2)
                   
{
                       
if (i == 1 || i == 11 || i == 14)
                       
{
                           
// textEdit2.Text = textEdit2.Text + "|" + item.Caption;
                           
SkinGroup.Items.Add(item);
                       
}
                   
}
                   
else if (TempIndex == 3)
                   
{
                       
if (i == 2 || i == 3 || i == 4)
                       
{
                           
//textEdit3.Text = textEdit3.Text + "|" + item.Caption;
                           
SkinGroup.Items.Add(item);
                       
}
                   
}
                   
else
                   
{
                   
}

}             }
           
recombinationSkin.Gallery.Groups.Add(SkinGroup);
           
DefaultLookAndFeel Custom = new DefaultLookAndFeel();
           
Custom.LookAndFeel.SetSkinStyle("Office 2010 Blue");

//RibbonGralleryBarItem控件皮肤选择事件
       
private void recombinationSkin_GalleryItemClick(object sender,
GalleryItemClickEventArgs e)
       
{
            string
SkinValue=e.Item.Caption;
          
DefaultLookAndFeel Custom = new
DefaultLookAndFeel();
          
Custom.LookAndFeel.SetSkinStyle(SkinValue);
          

        }

DevExpress Ribbongallerybaritem选择性皮肤重组,布布扣,bubuko.com

时间: 2024-10-20 10:35:09

DevExpress Ribbongallerybaritem选择性皮肤重组的相关文章

使用DevExpress改变WinForm皮肤(VS)

基于步入DevExpress的使用(VS),进一步使用DevExpress改变WinForm皮肤,适合初学者. 提示: 1.对于DevExpress菜单中的RepositoryItemComboBox没有EditValue属性,无法直接获取选择的值,但可以在其事件中将其转化为ComboBoxEdit控件来获取.如下: private void repositoryItemComboBox1_SelectedValueChanged(object sender, EventArgs e) { Co

DevExpress增加皮肤风格选择

1.Run Design 增加一个RibbonGalleryBarItem,命名rgbiSkins2.主窗体构造函数增加 InitSkinGallery();3.增加皮肤初始化函数 void InitSkinGallery() { SkinHelper.InitSkinGallery(rgbiSkins, true); }4.增加一个Group,把皮肤风格rgbiSkins拖进去 DevExpress增加皮肤风格选择

Devexpress -换皮肤

一.在项目下新建RibbonForm  命名为:useSkin 二.添加引用DevExpress.OfficeSkins      DevExpress.UserSkins.BonusSkins 三.将ribbonPage1的Text属性设置为:皮肤 ribbonPageGroup1的Text属性设置为:更换皮肤 在ribbonPageGroup1下新建个ribbonGalleryBarItem1,将其Caption的属性设置为:请选择您喜欢的皮肤,并添GalleryItemClick    事

使用xml文件保存DevExpress皮肤选择

上篇随笔中写了如何使用DevExpress的皮肤控件,选择一个皮肤之后,如果不保存在本地,下次打开程序还需要重新选择,选择皮肤也就没有意义了,于是想到使用xml文件方式保存皮肤,代码如下: using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text;

devexpress设置皮肤、字体以及折叠菜单、伸缩Panel的实现

1.为了体现系统的个性化,越来越多的系统增加了换肤功能.这里例举一个devexpress实现换肤的案例,效果图对比: 第二张图片中更换了皮肤与字体. 2.皮肤数据源绑定代码: //循环添加皮肤名称 foreach (DevExpress.Skins.SkinContainer skin in DevExpress.Skins.SkinManager.Default.Skins) cmb_skins.Items.Add(skin.SkinName); 3.第二张图与第一张图比较,伸缩Panel显示

DevExpress中GridControl自定义汇总列值(有选择性的汇总)

今天碰到有同事遇到这个方面的需求,贴一下吧. private void gvTop_CustomSummaryCalculate(object sender, CustomSummaryEventArgs e) { if (e.IsTotalSummary && e.SummaryProcess == CustomSummaryProcess.Finalize) { // 数据源 var data = this.gcTop.DataSource as List<StockOrderD

DevExpress 窗体换肤

本文参考引用:http://www.cnblogs.com/dreamflycc/archive/2012/09/14/2685308.html 注意,如果控件已汉化,与上面参考的略有不同 1.添加引用: 2.在ribbonPageGroup下新建个ribbonGalleryBarItem,并添加GalleryItemClick 事件:ribbonGalleryBarItem1_GalleryItemClick:    3.在应用程序的主入口里添加: static class Program {

使用DevExpress实现界面换肤功能

最近要用到devExpress,一句话,很好很强大,比起vs自带的winform界面,种类和花样要多了不少,然而,强力的功能带来了庞大的信息量,所以我打算通过一些小模块来和大家一起对它进行探讨和研究. 今天先研究一下他的换肤功能.在控件中,其默认提供了18中风格让我们选择,如下图: 下面就看看怎么实现让界面切换到选中风格的功能.先建立一个项目,引入一个button和一个grid如下图: 由于在devExpress.skins.skinManager.Default.Skins中只有13中皮肤所以

Fedora20 MATE Destop 环境下安装Sougoupinyin输入法+皮肤

卸载ibus # yum erase ibus* 选择性安装 fcitx # yum install fcitx fcitx-configtool $ ls -a $ vi .bashrc  .bash_profile /etc/profile#追加 ____~~~ export GTK_IM_MODULE=fcitx export QT_IM_MODULE=fcitx export XMODIFIERS="@im=fcitx"____~~~ # fcitx --version#成功