<div class="meta" robots="noindex">

</div>

Method

# Graphics.FillRect

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

<div class="warning">

<div class="title">

Warning

</div>

This item was deprecated in version 2019r2. Please use `Graphics.FillRectangle<graphics.fillrectangle>` as a replacement.

</div>

## Description

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

## Notes

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

## Sample code

This example draws a rectangle with a red interior.

``` xojo
g.ForeColor = &cff0000 ' Red
g.FillRect(10, 10, 100, 60)
```

## Compatibility

All project types on all supported operating systems.
