Hi ,
I want to get the object of UltraToolbarsManager in a form by its name , but it is not a control , I can not get it by loop all the controls , how can i do?
Jason
Thanks all, It works well as your suggustion!
Hello Jason,
Thank you for your response.
You can do what you want using reflection:
var fields = this.GetType().GetRuntimeFields();var tbManager = (from tmp in fields where tmp.FieldType == typeof(UltraToolbarsManager) select tmp).First().GetValue(this) as UltraToolbarsManager;
Hi Jason,
You'll have to find the components collection, and iterate over components.Components collection. components is an IContainer, and components.Components is a ComponentCollection. I am using the extension method OfType<> to find the toolbars manager: components.Components.OfType<UltraToolbarsManager>. After you have the enumerable of UltraToolbarsManager you can iterate over it and find what you are looking for by it's Name property.
HTH,
Emanuel
Maybe I was not very clear expression. I means I have get a form object , I wanna loop all the control to get the ultratoolbarsmanager object ,but ultratoolbarsmanager is not a control , I can not the it .
Thank you for contacting Infragistics.
In order to reference the UltraToolbarsManager from code you need to already know the name it was given in the designer. Once you know that you can use code similar to the following:
VB: Me.UltraToolbarsManager1
C#: this.ultraToolbarsManager1;