Imports System.Diagnostics
Imports Infragistics.Win
Imports Infragistics.Win.UltraWinExplorerBar
Private Sub Button10_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles button10.Click
' Add a key action mapping that will activate the first group in the control when the
' F3 key is pressed, but only when the control style is ExplorerBar and the control is
' not currently editing a Group or Item name.
Dim myKeyActionMapping As UltraExplorerBarKeyActionMapping = _
New UltraExplorerBarKeyActionMapping(Keys.F3, _
UltraExplorerBarAction.ActivateFirstGroup, _
UltraExplorerBarStates.ActiveGroupIsFirstGroup Or UltraExplorerBarStates.InEditMode, _
UltraExplorerBarStates.ExplorerBarMode, _
0, _
0)
Me.ultraExplorerBar1.KeyActionMappings.Add(myKeyActionMapping)
' Find the any keyaction mappings that invoke the ActivateLastGroup action and add disallowed
' and required states.
Dim keyActionMapping As UltraExplorerBarKeyActionMapping
For Each keyActionMapping In Me.ultraExplorerBar1.KeyActionMappings
If (keyActionMapping.ActionCode = UltraExplorerBarAction.ActivateLastGroup) Then
keyActionMapping.StateDisallowed = keyActionMapping.StateDisallowed Or UltraExplorerBarStates.ListbarMode
keyActionMapping.StateRequired = keyActionMapping.StateRequired Or UltraExplorerBarStates.ActiveItemIsFirstItemInGroup
End If
Next
End Sub