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

# TCustomShape.StyleChanged

Implements an OnChange event handler signalled when the Brush or the Pen on the control has been changed.

## Declaration

Source position: extctrls.pp line 298

`public procedure TCustomShape.StyleChanged(`
`Sender: TObject`
`);`

## Arguments

`Sender` |  | Object for the event notification.

## Description

StyleChanged is a method used to perform actions needed when the Brush or Pen for the shaped control has been changed. StyleChanged is assigned to the OnChanged event handler (in both Brush and Pen) in the Create constructor.

Sender contains the object instance for the event notification, but it is not used in the implementation.

StyleChanged ensures that the control has an assigned Parent with a valid Handle before calling Invalidate to redraw the control. No actions are performed in the handler if Parent is Nil, when the control is not Visible, or at design-time.

## See also

TCustomShape.Brush |  | The Brush used to fill the shaped control.
TCustomShape.Pen |  | The Pen used to draw lines on the shaped control.
TCustomShape.Create |  | Constructor for the class instance.
TBrush |  | The Brush to be used to Paint on the current Canvas.
TPen |  | Represents a pen used to draw on a canvas.
TControl.Parent |  | The control within which the control is shown.
TControl.Visible |  | Allows the control, and all of its children, to be displayed or hidden.
TControl.Invalidate |  | Causes a delayed Repaint of the control by marking its visible area of the control as invalid.
TComponent.ComponentState