码迷,mamicode.com
首页 > 其他好文 > 详细

DevExpress Ribbongallerybaritem选择性皮肤重组

时间:2014-05-02 19:10:54      阅读:330      评论:0      收藏:0      [点我收藏+]

标签:style   blog   tar   ext   int   string   

  

 

bubuko.com,布布扣

 

 

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

DevExpress Ribbongallerybaritem选择性皮肤重组

标签:style   blog   tar   ext   int   string   

原文地址:http://www.cnblogs.com/xiaoliao/p/3703435.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!