RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TToolButton.SetBounds Method

Changes the position and size of the button in a single operation.

Pascal
procedure SetBounds(ALeft: Integer; ATop: Integer; AWidth: Integer; AHeight: Integer); override;
C++
virtual __fastcall SetBounds(int ALeft, int ATop, int AWidth, int AHeight);

Call SetBounds to set the Left, Top, Width, and Height properties at once. By calling SetBounds, you guard against a paint operation occurring after one property is set and before the next, which can cause screen flicker. 

SetBounds also provides the underlying implementation for setting these four properties. 

As implemented in TToolButton, SetBounds ensures that the new position and dimensions of the tool button fit within the constraints imposed by its parent toolbar, and cause the parent toolbar to resize, if necessary, to accommodate the changes in the tool button. 

 

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!