Class
Size
Description
An object used to represent the dimensions of an object.
Methods
Name |
Parameters |
Returns |
Shared |
---|---|---|---|
Size |
|||
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 As Size
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; DesktopCanvas control; DesktopWindow, DesktopContainer, Point, Rect classes.