Table of Contents
Description
.SetBounds
will set 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.
This is the general form of SetBounds
:
1 |
.SetBounds(Left,Top,Width,Height) |
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.
In the next post, we will show you the example of SetBounds
for each one of them.
Note for beta release users
In practice, the only difference between DelphiVCL4Python release version and the beta version is only in how you write the DelphiVCL
. Here is the example for how you import the library:
- Release version:
1 |
from delphivcl import * |
- Beta version:
1 |
from DelphiVCL import * |
Watch this comprehensive introduction to Python GUI Development with DelphiVCL library video by Jim McKeeth:
Also, watch the following webinar by Ian Barker on How to create a real Windows app step-by-step guide:
Check out DelphiVCL which easily allows you to build GUIs for Windows using Python.
Check out Python4Delphi which easily allows you to build Python GUIs for Windows using Delphi.
References & further readings
[1] Embarcadero DocWiki. (2014).
Vcl.Controls.TControl.SetBounds
. Embarcadero DocWiki. Embarcadero Technologies. docwiki.embarcadero.com/Libraries/Sydney/en/ Vcl.Controls.TControl.SetBounds