The Shape control is a graphical control used to create rectangles, squares, ovals, circles, rounded rectangles, or rounded squares.
Shape
The Shape control has the following properties, methods, and events.
| Properties | Methods | Events |
|---|---|---|
| BackColor, ForeColor | Move | None |
| BackStyle | Refresh | |
| BorderColor | ZOrder | |
| BorderStyle | ||
| BorderWidth | ||
| Container | ||
| DrawMode | ||
| FillColor | ||
| FillStyle | ||
| Height, Width | ||
| Left, Top | ||
| Name | ||
| Parent | ||
| Shape | ||
| Tag | ||
| Visible |
You can set the shape style, color, fill style, border color, and border style of any of the shapes you draw on a form.
For simple uses, the Shape control allows you to create a variety of shapes without writing any code. For more advanced functionality you need to use the DrawLine and DrawCircle methods.
You can draw a Shape control in a container, but it can't act as a container. The effect of setting the BorderStyle property depends on the setting of the BorderWidth property. If BorderWidth is not 1 and BorderStyle is not 0 or 6, BorderStyle is set to 1.