This topic has not yet been rated - Rate this topic

IHTMLEventObj2::y Property

Gets or sets the y-coordinate (in pixels) of the mouse pointer, or user's finger, offset from the closest relatively positioned parent element of the element that fired the event.

Syntax


HRESULT IHTMLEventObj2::get_y(long *p);HRESULT IHTMLEventObj2::put_y(long v);

Parameters

p
Pointer to a variable of type long that receives the y-coordinate, in pixels.
v
long that specifies the y-coordinate, in pixels.

Return Value

Returns S_OK if successful, or an error value otherwise.

Remarks

If the event firing element is relatively positioned, then the y-coordinate from the boundary of the element is returned. If the event firing element and all of its parent elements are not relatively positioned, then the IHTMLEventObj2::y property returns a coordinate relative to the body element.

If the mouse or finger is outside the window at the time the event fires, this property returns -1.

Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ