From Xojo Documentation

Revision as of 23:19, 4 June 2019 by Gperlman (talk | contribs)

Graphics.FillRectangle(x As Double, y As Double, width As Double, height As Double)

Supported for all project types and targets.

Draws a rectangle filled with the current color. The current color is set with the DrawingColor property.


X and Y are the coordinates of the top-left corner. Width and Height specify the size of the rectangle.

Sample Code

This example (in the Paint event of a Canvas control) draws a rectangle with a red interior.

g.DrawingColor = &cff0000 // Red
g.FillRectangle(10, 10, 100, 60)