Displaying ToolBar Button Descriptions in a StatusBar Control

It is possible to assign tooltip texts to buttons of a toolbar, but there is no built-in support for displaying information about a button in a statusbar when hovering a toolbar button. The code below determines the hovered button and displays its tooltip text in a statusbar:

Imports System.Windows.Forms


Private Sub ToolBar1_MouseMove( _
    ByVal sender As Object, _
    ByVal e As MouseEventArgs _
) Handles Me.ToolBar1.MouseMove
    Dim b As ToolBarButton
    For Each b In Me.ToolBar1.Buttons
        If b.Rectangle.Contains(New Point(e.X, e.Y)) Then
            If Me.StatusBar1.Text <> b.ToolTipText Then
                Me.StatusBar1.Text = b.ToolTipText
            End If
        End If
    Next b
End Sub