property ScrollBar.ValueFromPoint (X as OLE_XPOS_PIXELS, Y as OLE_YPOS_PIXELS) as Long
Retrieves the value 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 X location of the mouse pointer. The x values is always expressed in client coordinates.
Long A long expression that indicates the value from the point.

Use the ValueFromPoint property to determine the value from the cursor. The PartFromPoint property specifies the part of the control from the cursor. Use the VisiblePart or VisibleParts property to specify the visible parts of the control.

The following VB sample jumps to the value from the point when the user clicks the button:

Private Sub ScrollBar1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
    ScrollBar1.Value = ScrollBar1.ValueFromPoint(-1, -1)
End Sub

The following VB.NET sample jumps to the value from the point when the user clicks the button:

Private Sub AxScrollBar1_MouseDownEvent(ByVal sender As System.Object, ByVal e As AxEXSCROLLBARLib._IScrollBarEvents_MouseDownEvent) Handles AxScrollBar1.MouseDownEvent
    AxScrollBar1.Value = AxScrollBar1.get_ValueFromPoint(-1, -1)
End Sub

The following C++ sample jumps to the value from the point when the user clicks the button:

void OnMouseDownScrollbar1(short Button, short Shift, long X, long Y) 
{
	m_scrollbar.SetValue( m_scrollbar.GetValueFromPoint(-1,-1) );
}

The following C# sample jumps to the value from the point when the user clicks the button:

private void axScrollBar1_MouseDownEvent(object sender, AxEXSCROLLBARLib._IScrollBarEvents_MouseDownEvent e)
{
    axScrollBar1.Value = axScrollBar1.get_ValueFromPoint(-1, -1);
}

The following VFP sample jumps to the value from the point when the user clicks the button:

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

with thisform.scrollbar1
	.Value = .ValueFromPoint(-1,-1)
endwith