Class

Size


Description

An object used to represent the dimensions of an object.

Properties

Name

Type

Read-Only

Shared

Area

Double

Height

Double

Width

Double

Methods

Name

Parameters

Returns

Shared

Clone

Constructor

Constructor

Width As Double, Height As Double

Property descriptions


Size.Area

Area As Double

Calculates the area of the object as the width times the height.

This property is read-only.

This example reads the Area property.

Var rectSize As New Size
rectSize.Height = 150
rectSize.Width = 200

MessageBox(rectSize.Area.ToString)

Size.Height

Height As Double

The height of the object, in pixels.

This example increases the height and width of the Size object.

Var rectSize As New Size(100, 75)
rectSize.Height = 150
rectSize.Width = 200

Size.Width

Width As Double

The width of the object, in pixels.

This example increases the height and width of the Size object.

Var rectSize As New Size(100, 75)
rectSize.Height = 150
rectSize.Width = 200

Method descriptions


Size.Clone

Clone

Creates a duplicate Size object.

This example clones a Size object. The two Size objects have been added as properties to the window.

rectSize2 = rectSize.Clone

Size.Constructor

Constructor

Note

Constructors are special methods called when you create an object with the New keyword and pass in the parameters above.

Creates a Size object with a Size of 0, 0.


Size.Constructor

Constructor(Width as Double, Height as Double)

Note

Constructors are special methods called when you create an object with the New keyword and pass in the parameters above.

Creates a Size object from the passed width and height.

Var shapeSize As New Size(100, 75)

Sample code

This example reads the Area property.

Var rectSize As New Size
rectSize.Height = 150
rectSize.Width = 200

MessageBox(rectSize.Area.ToString)

Compatibility

All project types on all supported operating systems.

See also

Object parent class; Canvas control; Window, DesktopContainer, Point, Rect classes.