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

# TControl.SetVisible

Sets the value for the Visible property.

## Declaration

Source position: controls.pp line 1353

`protected procedure TControl.SetVisible(`
`Value: Boolean`
`); virtual;`

## Arguments

`Value` |  | New value for the Visible property.

## Description

Changing the value for the property causes additional actions to be performed.

VisibleChanging is called to notify event handler routines for the control. The Perform method is used to send a CM_VISIBLECHANGED control message to the processing loop for the control.

Preferred width and height values in the control, and its children (when derived from TWinControl), are invalidated. To minimize the overhead from the DoAutoSize method, auto-sizing is temporarily disabled when the control is updated. The AdjustSize method is called to perform the equivalent of DoAutoSize without the extra overhead of getting the preferred sizes from the widgetset class. If the control is not Visible but has a Parent control, the AdjustSize method in Parent is called.

VisibleChanged is called to notify event handler routines for the control.

SetVisible ensures that ControlState is updated to include the value csVisibleSetInLoading when csLoading is included in the ComponentState property.

## See also

TControl.Visible |  | Allows the control, and all of its children, to be displayed or hidden.