Imports Infragistics.Win.UltraWinToolbars ... Private Sub Create_Groups_of_Mutually_Exclusive_Statebuttons_Load( _ ByVal sender As System.Object, _ ByVal e As System.EventArgs) Handles MyBase.Load ' Create PopupMenuTool Dim menu1 As New PopupMenuTool("menu1") menu1.SharedProps.Caption = "Layout" ' Creates a new OptionSet ' AllowAllUp is set to True, so all state buttons can be ' unchecked at the same time Me.UltraToolbarsManager1.OptionSets.Add(True, "option1") ' Creates three new state button tools Dim Left As New StateButtonTool("Left") Left.SharedProps.Caption = "Left" Dim Center As New StateButtonTool("Center") Center.SharedProps.Caption = "Center" Dim Right As New StateButtonTool("Right") Right.SharedProps.Caption = "Right" ' Adds tools to the tools collection Me.UltraToolbarsManager1.Tools.Add(Left) Me.UltraToolbarsManager1.Tools.Add(Center) Me.UltraToolbarsManager1.Tools.Add(Right) ' Sets the 3 state button tools to be in the same OptionSet Left.OptionSet = Me.UltraToolbarsManager1.OptionSets("option1") Center.OptionSet = Me.UltraToolbarsManager1.OptionSets("option1") Right.OptionSet = Me.UltraToolbarsManager1.OptionSets("option1") ' Adds the tools to a menu menu1.Tools.Add(Left) menu1.Tools.Add(Center) menu1.Tools.Add(Right) ' Checkmarks will be displayed next to the state button tools in a menu Left.MenuDisplayStyle = StateButtonMenuDisplayStyle.DisplayCheckmark Center.MenuDisplayStyle = StateButtonMenuDisplayStyle.DisplayCheckmark Right.MenuDisplayStyle = StateButtonMenuDisplayStyle.DisplayCheckmark ' Add the PopupMenuTool to tools collection Me.UltraToolbarsManager1.Tools.Add(menu1) ' Add the PopupMenuTool to the Toolbar's tools collection Me.UltraToolbarsManager1.Toolbars(0).Tools.Add(menu1) End Sub