Share via


Sys.UI.Point Class

Creates an object that contains a set of integer coordinates that represent a position.

Namespace: Sys.UI

Inherits: None

var objectPointVar = new Sys.UI.Point(x, y);

Constructors

Name

Description

Sys.UI.Point Constructor

Initializes a new instance of the Point class.

Members

Name

Description

Sys.UI.Point x Property

Gets the x-coordinate of the Point object in pixels. This property is read-only.

Sys.UI.Point y Property

Gets the y-coordinate of the Point object in pixels. This property is read-only.

Remarks

The getLocation method of the Sys.UI.DomElement class returns a Point object.

Example

The following code example shows how to use the Point class.

// Get the location of the element
var elementLoc = Sys.UI.DomElement.getLocation(elementRef);
result += "Before move - Label1 location (x,y) = (" + 
           elementLoc.x + "," + elementLoc.y + ")<br/>";
// Move the element
Sys.UI.DomElement.setLocation(elementRef, 100, elementLoc.y);
elementLoc = Sys.UI.DomElement.getLocation(elementRef);
result += "After move  - Label1 location (x,y) = (" + 
           elementLoc.x + "," + elementLoc.y + ")<br/>";
// Get the location of the element
var elementLoc = Sys.UI.DomElement.getLocation(elementRef);
result += "Before move - Label1 location (x,y) = (" + 
           elementLoc.x + "," + elementLoc.y + ")<br/>";
// Move the element
Sys.UI.DomElement.setLocation(elementRef, 100, elementLoc.y);
elementLoc = Sys.UI.DomElement.getLocation(elementRef);
result += "After move  - Label1 location (x,y) = (" + 
           elementLoc.x + "," + elementLoc.y + ")<br/>";

See Also

Reference

new Operator

Other Resources

Language Reference