This topic has not yet been rated - Rate this topic

RangeFromPoint Method

Office 2003

Returns the most detailed object at the specified location in a chart workspace. For example, if you specify the x- and y-coordinates of a point, the corresponding ChPoint object is returned, even though a series also exists at those coordinates.

expression.RangeFromPoint(X, Y)

expression    Required. An expression that returns a ChartSpace object.

X    Required Long.

Y    Required Long.

Returns the Range object that is positioned at the specified pair of screen coordinates. If there isn't a range located at the specified coordinates, this method returns Nothing.

expression.RangeFromPoint(X, Y)

expression    Required. An expression that returns a Window object.

X   Required Long.

Y   Required Long.

Example

This example changes the value of an HTML text box named "Textbox" when the mouse pointer passes over an object in ChartSpace1. The value of the text box reflects the type of object that the mouse pointer passes.

Sub ChartSpace1_MouseMove(ByVal Button, ByVal Shift, ByVal x, ByVal y)

    ' Set the value of Textbox to the type of object .
    Textbox.Value = TypeName(ChartSpace1.RangeFromPoint(x,y))
End Sub

				




Did you find this helpful?
(1500 characters remaining)
© 2013 Microsoft. All rights reserved.