Imports System.Diagnostics
Imports Infragistics.Win
Imports Infragistics.Win.UltraWinExplorerBar
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles button4.Click
' If there is no checked item, set the StateButtonCheckStyle to 'ExclusiveWithinControl'
' and check the first state button type item we find.
If (Me.ultraExplorerBar1.CheckedItem Is Nothing) Then
Me.ultraExplorerBar1.StateButtonCheckStyle = StateButtonCheckStyle.ExclusiveWithinControl
' Iterate thru all Groups and Items and check the first StateButton type Item we find
Dim group As UltraExplorerBarGroup
For Each group In Me.ultraExplorerBar1.Groups
Dim item As UltraExplorerBarItem
For Each item In group.Items
If item.SettingsResolved.Style = ItemStyle.StateButton Then
item.Checked = True
Exit For
End If
Next
' If we set a CheckedItem above, exit our Group loop.
If (Not Me.ultraExplorerBar1.CheckedItem Is Nothing) Then
Exit For
End If
Next
End If
End Sub