Imports System.Diagnostics
Imports Infragistics.Win
Imports Infragistics.Win.UltraWinExplorerBar
Private Sub Button38_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles button38.Click
' Find the first item in the last group that is Active or disabled and display its text.
If (Me.ultraExplorerBar1.Groups.Count < 1) Then
Return
End If
' Get the last Group.
Dim lastGroup As UltraExplorerBarGroup = Me.ultraExplorerBar1.Groups(Me.ultraExplorerBar1.Groups.Count - 1)
If (Not lastGroup Is Nothing) Then
' Iterate thru each of its Items looking for an Item that is Active or disabled.
Dim item As UltraExplorerBarItem
For Each item In lastGroup.Items
If (item.Active = True Or item.SettingsResolved.Enabled = False) Then
Debug.WriteLine(String.Format("The first item in the last group (i.e., group '{0}') that is Active or Disabled is: '{1}'", item.Group.Text, item.Text))
Exit For
End If
Next
End If
End Sub