From Xojo Documentation

You are currently browsing the old Xojo documentation site. Please visit the new Xojo documentation site!

Property (As Integer )
aRealbasic.Rect.Top = newIntegerValue
IntegerValue = aRealbasic.Rect.Top

New in 2011r2

Supported for all project types and targets.

The top edge of the rect on the Y axis.

Sample Code

This example is in the Paint event. It computes the top of a rect that represents the union of two rects.

Dim i, j As Integer
// To demonstrate the Union feature, we'll draw a Cyan rectangle
// around both the draggable rects.
Dim u As Realbasic.Rect = rectone.Union(recttwo)
buffer.Graphics.ForeColor = CyanColor
buffer.Graphics.DrawRect(u.Left, u.Top, u.Width, u.Height)
theSize = u.Size
Dim theTop As Realbasic.Point = u.Top
i = theTop.x
j = theTop.y