How to customize Skin gallery-remove/rename skins and Groups

Source: Internet
Author: User

1. REMOVE (HIDE) A specific SKIN
Traverse through the Gallery group collection, then through its gallery item collection and hide a corresponding item:

Private voidInitribbonskingallery () {skinhelper.initskingallery (Skingallerybaritem);}string[] Skinstohide = {"Black","Blue","Seven"," Sharp"};//populate with names of unnecessary skinsPrivate voidHideskins (string[] skinstohide) {             for(vari =0; i < SkinGalleryBarItem.Gallery.Groups.Count; i++) {                varGroup =Skingallerybaritem.gallery.groups[i]; if(Group = =NULL) {                    Continue; }                 for(varj =0; J < Group. Items.Count; J + +) {                    varitem =Group.                    ITEMS[J]; if(Item = =NULL) {                        Continue; }                    foreach(varSkininchskinstohide) {                        if(String.Equals (item. Caption, skin) {item. Visible=false; }                    }                }            }}
Private Subinitribbonskingallery () skinhelper.initskingallery (Skingallerybaritem)End SubPrivateSkinstohide () as String= {"Black","Blue","Seven"," Sharp"}'populate with names of unnecessary skinsPrivate SubHideskins (ByValSkinstohide () as String)             fori =0  toSkinGalleryBarItem.Gallery.Groups.Count-1                DimGroup =skinGalleryBarItem.Gallery.Groups (i)IfGroup is  Nothing  Then                    Continue  for                End If                 forj =0  toGroup. Items.Count-1                    Dimitem =Group. Items (j)IfItem is  Nothing  Then                        Continue  for                    End If                     for  eachSkininchSkinstohideIf String. Equals (item. Caption, skin) Thenitem. Visible=False                        End If                    NextSkinNextJNextIEnd Sub

This was discussed in the "to" remove certain skins from the bonus Skins collection ticket.

2. REMOVE A specific SKIN GROUP
Remove A required group from the collection:

string " Standard Skins " ; Removeskingroups (skingroup); void Removeskingroups (string  skingroup) {            SkinGalleryBarItem.Gallery.Groups.Remove ( SkinGalleryBarItem.Gallery.Groups.OfType<GalleryItemGroup> (). First (x = string.equals (x.caption, Skingroup));                       }
Private  as String " Standard Skins " removeskingroups (skingroup) void removeskingroups (String  skingroup)            SkinGalleryBarItem.Gallery.Groups.Remove (SkinGalleryBarItem.Gallery.Groups.OfType ( of Galleryitemgroup) (). First (FunctionString. Equals (X.caption, Skingroup)))

This issue was discussed in the What to remove the ' Theme skin ' skin Group from the In-ribbon gallery populated with Availab Le skins thread.

3. REMOVE GROUPING

Fill the In-ribbon and In-dropdown Gallery with required skins manually.
To obtain all available skins in your project with the use of the Skinmanager.skins property. To populate the In-dropdown Gallery, handle theribbongallerybaritem.galleryinitdropdowngallery event:

DevExpress.XtraBars.RibbonGalleryBarItem Skingallerybaritem; Skincontainercollection Skins;voidInitskingallery () {//Skinhelper.initskingallery (Skingallerybaritem, true);Skins =SkinManager.Default.Skins;  for(inti =0; I < -; i++) {                intindex = rgbiskins.gallery.groups[0]. Items.Add (NewGalleryitem ()); Galleryitem Item= skingallerybaritem.gallery.groups[0].                Items[index]; Item. Description=Skins[index].                Skinname; Item. Image=Galleryimagecollection.images[i]; }}Private voidSkingallerybaritem_galleryinitdropdowngallery (Objectsender, Inplacegalleryeventargs e) {E.popupgallery.allowhoverimages=false; E.popupgallery.itemclick+=NewGalleryitemclickeventhandler (Popupgallery_itemclick);  for(inti =0; I < e.popupgallery.groups[0]. Items.Count; i++) {Galleryitem Item= e.popupgallery.groups[0].                Items[i]; Item. Description=Skins[i].                Skinname; Item. Caption=Skins[i].            Skinname; }}voidPopupgallery_itemclick (Objectsender, Galleryitemclickeventargs e) {DefaultBarAndDockingController1.Controller.LookAndFeel.SkinName=e.item.description;}
PrivateSkingallerybaritem asDevExpress.XtraBars.RibbonGalleryBarItemPrivateSkins asskincontainercollectionPrivate Subinitskingallery ()'Skinhelper.initskingallery (Skingallerybaritem, true);Skins =SkinManager.Default.Skins forI as Integer=0  to  -                DimIndex as Integer= RgbiSkins.Gallery.Groups (0). Items.Add (NewGalleryitem ())DimItem asGalleryitem = SkinGalleryBarItem.Gallery.Groups (0). Items (Index) item. Description=Skins (Index). Skinname item. Image=galleryimagecollection.images (i)NextIEnd SubPrivate SubSkingallerybaritem_galleryinitdropdowngallery (ByValSender as Object,ByValE asInplacegalleryeventargs) E.popupgallery.allowhoverimages=False            AddHandlerE.popupgallery.itemclick,AddressOfPopupgallery_itemclick forI as Integer=0  toE.popupgallery.groups (0). Items.Count-1                DimItem asGalleryitem = E.popupgallery.groups (0). Items (i) item. Description=Skins (i). Skinname item. Caption=Skins (i). SkinnameNextIEnd SubPrivate SubPopupgallery_itemclick (ByValSender as Object,ByValE asGalleryitemclickeventargs) DefaultBarAndDockingController1.Controller.LookAndFeel.SkinName=e.item.descriptionEnd Sub

See Skins gallery-how to remove Skins grouping ticket to learn more.

4. Change A SKIN NAME
Traverse through the Gallery group collection, then through it gallery item collection, obtain a required galleryitem an D Change the Galleryitem.caption property for this purpose.
Change/remove the DevExpress Style caption from the Skins Menu/drop-down Gallery for more information.

5. Change A SKIN ICON

Traverse through the Gallery group collection, then through its gallery item collection, obtain a required Galleryitem and set the Image and Hoverimage properties.
See Skins gallery-how to change a skin icon (image) and name (caption) for more information.

How to customize Skin gallery-remove/rename skins and Groups

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.