Dont know if its possible but can you hide or disable this part in the toolbar?
oh yes what a plum!
big thanks for your help
Looks good to me. I would just add a break or return statement after you remove the child element from the collection because there should only be one element of this type in the collection. Once you find and remove it, theres no point to looping over the other elements.
Big THANKS! I have managed to do it... i have written this, is it correct? or is there a better more efficent way of doing it?
public void AfterCreateChildElements(Infragistics.Win.UIElement parent) { if (!(parent is RibbonCaptionAreaUIElement)) { return; } foreach (UIElement child in parent.ChildElements) { if ((child is QatQuickCustomizeToolUIElement)) { parent.ChildElements.Remove(child); } } } public bool BeforeCreateChildElements(Infragistics.Win.UIElement parent) { // return false so PositionChildElements will get called // to do the default child element creation return false; }
You would need to remove this element manually using a creation filter. If you have never used creation filters before, the following article has a brief introduction: http://help.infragistics.com/Help/NetAdvantage/NET/2008.1/CLR2.0/html/Win_Creation_Filter.html. In your creation filter, the BeforeCreateChildElements should just return False. The AfterCreateChildElements should check the parent element type. If it is a RibbonCaptionAreaUIElement, you want to search its ChildElements collection and remove the child element of type QatQuickCustomizeToolUIElement.