Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
745
I want to find "UltraToolbarsManager" in my usercontrol's control collection
posted

Hi all,

I have a usercontrol, in which there are several controls, one of which is of type "UltraToolbarsManager". There is a requirement in which I have to write a control enumeration code through which I have to find this toolbar manager in the controls collection of the usercontrol, recursively of course. First I thought that I would simply find my toolbar manager in the controls collection, but this was not the case. So I referred to the *.designer.vb to learn that the UltraToolbarsManager control goes inside the "ToolbarsManager" property of a "UltraWinToolbars.UltraToolbarsDockArea" control, hence not available in the controls collection. For which I'll have to check the "ToolbarsManager" property as:

.
. 'c is type "Control"
. a lil snippet from a recursive function I wrote for enumerating control in a usercontrol
If c.GetType() = GetType(Infragistics.Win.UltraWinToolbars.UltraToolbarsDockArea) Then

  Dim x As Infragistics.Win.UltraWinToolbars.UltraToolbarsDockArea = CType(c, Infragistics.Win.UltraWinToolbars.UltraToolbarsDockArea)
  
  If x.ToolbarsManager IsNot Nothing AndAlso m_toolbar Is Nothing Then
    Dim o As Object = x.ToolbarsManager
    If o.GetType() = GetType(UltraToolbarsManager) Then
      m_toolbar = CType(o, UltraToolbarsManager) 'thats what we were here for

      Exit For

    End If
  End If

End If
.
.

this works, only the problem is that the documentation says about ToolbarsManager that "This is an internal property and should never be set directly.". I'm not setting it, just getting it, is that ok? And if ToolbarsManager property is not recommended (intellisense also doesnt show this property), what else is there that I should use alternatively locate my ultratoolbars control.

Hope I made myself clear in this question.

thanks.