Documentation for: ASP.NET Ajax Version 1.0

This documentation is for a previous version. For the current released version, see the ASP.NET Ajax documentation on MSDN.

 

 

 

 

 

 

 

Sys.UI.Point Class

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

Namespace: Sys.UI

Inherits: None

Syntax

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

Constructors

Name

Description

Point Constructor

Initializes a new instance of the Point class.

Members

Name

Description

x Property

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

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.

cs

// 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/>";

vb

// 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/>";