Hi
I need a popupgallery without the up and down buttons. Is there a way to disable or can the visibility be set of these buttons ?
Hello Alti,
This is default style for the PopUpGallery tool. What you could do in your case is setting the PrefferedSize to Normal of this tool and the style will be changed.
Please verify if this working for your scenario and if not please provide me more details of what you are trying to achieve with it.
Hello Danko
Thank you for the fast reply. But that is not the Poblem. The gallery works fine in the application the only thing is that i want to disable the Up and Down button. I should look like a combox (only 1 button on the left side witch opens the drop down list)
hi ,
Thanks it works
Basically the buttons visiblity is based on the "ShowPreviewInRibbon" property of the PopUpGalleryTool, and if you set it to False the buttons wouldn't be visible anymore. If you would like to keep the preview Area as well you could use a CreationFilter to remove the scroll buttons and extend the drop down button in the whole area.
This is not a recommended apporach but I have achieve it using the code below:
class RemovingScrollPreviewButtons : IUIElementCreationFilter { public void AfterCreateChildElements(UIElement parent) { GalleryPreviewScrollUpButtonUIElement buttonUP; GalleryPreviewScrollDownButtonUIElement buttonDOWN; GalleryPreviewDropDownButtonUIElement buttonDROP; GalleryPreviewButtonAreaUIElement el = parent as GalleryPreviewButtonAreaUIElement; if (el != null) { buttonUP = (GalleryPreviewScrollUpButtonUIElement)parent.GetDescendant(typeof(GalleryPreviewScrollUpButtonUIElement)) as GalleryPreviewScrollUpButtonUIElement; buttonUP.Rect = new System.Drawing.Rectangle(buttonUP.Rect.X, buttonUP.Rect.Y, 0, 0); buttonDOWN = (GalleryPreviewScrollDownButtonUIElement)parent.GetDescendant(typeof(GalleryPreviewScrollDownButtonUIElement)) as GalleryPreviewScrollDownButtonUIElement; buttonDOWN.Rect = new System.Drawing.Rectangle(buttonDOWN.Rect.X, buttonDOWN.Rect.Y, 0, 0); buttonDROP = (GalleryPreviewDropDownButtonUIElement)parent.GetDescendant(typeof(GalleryPreviewDropDownButtonUIElement)) as GalleryPreviewDropDownButtonUIElement; buttonDROP.Rect = el.Rect; } } public bool BeforeCreateChildElements(UIElement parent) { return false; } }
After that you should just add an instance of your class to the Creation Filter property of the UltraToolbarsManager like:
ultraToolbarsManager1.CreationFilter = new RemovingScrollPreviewButtons();
Please let me know if this is not what you are looking for.