property StatusBar.PanelFromPoint (X as OLE_XPOS_PIXELS, Y as OLE_YPOS_PIXELS) as Panel
Retrieves the panel from the point.

TypeDescription
X as OLE_XPOS_PIXELS A single that specifies the current X location of the mouse pointer. The x values is always expressed in client coordinates.
Y as OLE_YPOS_PIXELS A single that specifies the current Y location of the mouse pointer. The y values is always expressed in client coordinates.
Panel A Panel object that specifies the panel from the cursor or nothing if no panel at the cursor.
Use the PanelFromPoint property to get the Panel from the point specified by the {X,Y}. The X and Y coordinates are expressed in client coordinates, so a conversion must be done in case your coordinates are relative to the screen or to other window. If the X parameter is -1 and Y parameter is -1 the PanelFromPoint property determines the handle of the Panel from the cursor. Use the Text property to access the text of the panel. Use the Index property to identify a panel in the status bar.

The following VB sample displays the caption from the cursor:

Private Sub StatusBar1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
    Dim p As EXSTATUSBARLibCtl.Panel
    With StatusBar1
        Set p = .PanelFromPoint(-1, -1)
        If (Not p Is Nothing) Then
            Debug.Print p.Text
        End If
    End With
End Sub

The following VB.NET sample displays the caption from the cursor:

Private Sub AxStatusBar1_MouseMoveEvent(ByVal sender As System.Object, ByVal e As AxEXSTATUSBARLib._IStatusBarEvents_MouseMoveEvent) Handles AxStatusBar1.MouseMoveEvent
    Dim p As EXSTATUSBARLib.Panel
    With AxStatusBar1
        p = .get_PanelFromPoint(-1, -1)
        If (Not p Is Nothing) Then
            Debug.Print(p.Text)
        End If
    End With
End Sub

The following C# sample displays the caption from the cursor:

private void axStatusBar1_MouseMoveEvent(object sender, AxEXSTATUSBARLib._IStatusBarEvents_MouseMoveEvent e)
{
    EXSTATUSBARLib.Panel p = axStatusBar1.get_PanelFromPoint(-1, -1);
    if (p != null)
        System.Diagnostics.Debug.WriteLine(p.Text);
}

The following C++ sample displays the caption from the cursor:

void OnMouseMoveStatusbar1(short Button, short Shift, long X, long Y) 
{
	CPanel panel = m_statusBar.GetPanelFromPoint( -1, -1 );
	if ( panel.m_lpDispatch != NULL )
		OutputDebugString( panel.GetText() );
}

The following VFP sample displays the caption from the cursor:

*** ActiveX Control Event ***
LPARAMETERS button, shift, x, y

with thisform.StatusBar1
	local p
	p = .PanelFromPoint(-1,-1)
	if ( !isnull(p) )
		wait window nowait p.Text
	endif
endwith