Imports Infragistics.Win.UltraWinToolbars
...
Private Sub Add_a_Popup_Menu_to_a_Toolbar_Load(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles MyBase.Load
Dim popupmenutool As New PopupMenuTool("popupmenutool")
' Adds the tool to the Toolbar Manager's Tools collection
Me.UltraToolbarsManager1.Tools.Add(popupmenutool)
Me.UltraToolbarsManager1.Toolbars.AddToolbar("MAIN")
Me.UltraToolbarsManager1.Toolbars(0).Tools.Add(popupmenutool)
popupmenutool.SharedProps.DisplayStyle = ToolDisplayStyle.ImageAndText
' Specifies a segmented Popup menu
popupmenutool.DropDownArrowStyle = DropDownArrowStyle.Segmented
' Specifies the Popup Style as Menu
popupmenutool.Settings.PopupStyle = PopupStyle.Menu
' Specifies the Popup menu to be torn away and floated.
popupmenutool.AllowTearaway = True
Dim textbox As New TextBoxTool("textbox")
Me.UltraToolbarsManager1.Tools.Add(textbox)
textbox.Text = "TextBox1"
' Adds the TextBox to the Popup menu
popupmenutool.Tools.Add(textbox)
Dim button As New ButtonTool("button")
' Adds a button tool the the Tools collection
Me.UltraToolbarsManager1.Tools.Add(button)
button.SharedProps.AppearancesSmall.Appearance.BackColor = Color.RosyBrown
button.SharedProps.Caption = "Button1"
button.SharedProps.DisplayStyle = ToolDisplayStyle.TextOnlyAlways
' Adds the Button to the Popup menu
popupmenutool.Tools.Add(button)
End Sub