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.Bounds Class

Creates an object that contains a set of integer coordinates representing position, width, and height.

Namespace: Sys.UI

Inherits: None

Syntax

var objectBoundsVar = new Sys.UI.Bounds(x, y, width, height);

Constructors

Name

Description

Bounds Constructor

Initializes a new instance of the Sys.UI.Bounds class.

Members

Name

Description

height Property

Gets the height of the Bounds object in pixels.

width Property

Gets the width of the Bounds object in pixels.

x Property

Gets the x-coordinate of the Bounds object in pixels.

y Property

Gets the y-coordinate the Bounds object in pixels.

Remarks

The getBounds method of the Sys.UI.DomElement class returns a Bounds object.

Example

The following example shows how to use the Bounds class.

cs

// Get the bounds of the element
var elementRef = $get("Label1");
var elementBounds = Sys.UI.DomElement.getBounds(elementRef);
var result = '';
result += "Label1 bounds x = " + elementBounds.x + "<br/>";
result += "Label1 bounds y = " + elementBounds.y + "<br/>";
result += "Label1 bounds width = " + elementBounds.width + "<br/>";
result += "Label1 bounds height = " + elementBounds.height + "<p/>";

vb

// Get the bounds of the element
var elementRef = $get("Label1");
var elementBounds = Sys.UI.DomElement.getBounds(elementRef);
var result = '';
result += "Label1 bounds x = " + elementBounds.x + "<br/>";
result += "Label1 bounds y = " + elementBounds.y + "<br/>";
result += "Label1 bounds width = " + elementBounds.width + "<br/>";
result += "Label1 bounds height = " + elementBounds.height + "<p/>";