[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] | Reference for unit 'Controls' (#lcl)

# TWinControl.SetShape

Specifies the non-rectangular shape of the widget.

## Declaration

Source position: controls.pp line 2439

`public procedure TWinControl.SetShape(`
`AShape: TBitmap`
`); overload; procedure TWinControl.SetShape(`
`AShape: TRegion`
`); overload;`

## Arguments

`AShape` |  | Shape for the control; TBitmap or TRegion in overloaded methods.

## Arguments

`AShape` |  | Shape for the control; TBitmap or TRegion in overloaded methods.

## Description

SetShape is an overloaded procedure used to set the shape for the control to the non-rectangular value in AShape. The overloaded methods allow AShape to be either a TBitmap or a TRegion value.

When TBitmap is used, the widgetset class calls its SetShape method to apply the TBitmap handle to the handle for the widget. No actions are performed in the method when a handle has not been allocated for the widgetset class.

When TRegion is used, SetWindowRgn in the LCL interface is called to apply the region in AShape to the handle for the control.