之前,我们学会了如何隐藏DevExpress的部分皮肤,但是还是看到3个分组?有没有什么办法隐藏3个分组呢?
我们直接看效果吧,看到了吗?DevExpress的皮肤分组直接没有了。
程序的运行效果如下图所示
以下是具体代码
SkinContainerCollection skins; void InitSkinGallery() { skins = SkinManager.Default.Skins; for (int i = 0; i < 14; i++) { int index = ribbonGalleryBarItem1.Gallery.Groups[0].Items.Add(new GalleryItem()); GalleryItem item = ribbonGalleryBarItem1.Gallery.Groups[0].Items[index]; item.Description = skins[index].SkinName; item.Image = SkinCollectionHelper.GetSkinIcon(item.Description, SkinIconsSize.Small); item.Hint = skins[i].SkinName; } } private void rgbiSkins_GalleryInitDropDownGallery(object sender, InplaceGalleryEventArgs e) { e.PopupGallery.AllowHoverImages = false; for (int i = 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; item.Hint = skins[i].SkinName; } }