Controls.TControl.SetBounds

From RAD Studio VCL Reference
Jump to: navigation, search

Contents

Delphi Information

From Controls.pas

	procedure SetBounds(ALeft: Integer;
		ATop: Integer;
		AWidth: Integer;
		AHeight: Integer); virtual;


Unit: Controls

Type: method

Visibility: public

Member Of: TControl

C++ Information

From Controls.hpp

	virtual void __fastcall SetBounds(int ALeft,
		int ATop,
		int AWidth,
		int AHeight);


Unit: Controls

Type: method

Visibility: public

Member Of: TControl

Description

Sets the Left, Top, Width, and Height properties all at once.


Use SetBounds to change all of the component's boundary properties at one time. The same effect can be achieved by setting the Left, Top, Width, and Height properties separately, but SetBounds changes all four properties at once ensuring that the control will not repaint between changes.

Specify the values for the Left, Top, Width, and Height properties as the value of the ALeft, ATop, AWidth, and AHeight parameters, respectively.

Calling SetBounds does not necessarily result in the Left, Top, Width, and Height properties changing to the specified values. Before the properties are changed, the AutoSize or Constraints property may limit the changes, and an OnCanResize (or OnConstrainedResize) event handler may change the new values. After the control's Left, Top, Width, and Height properties are changed, SetBounds generates an OnResize event.

Note:  Component writers can change the Left, Top, Width, and Height properties while bypassing all resize events and constraint or autosize logic by using the UpdateBoundsRect method instead.

See Also

Code Samples


Personal tools
Translations
Newest Version