Delphi tips:

Components: moving, resizing, selecting, dragging

 
How can you precisely manipulate Delphi components that are placed on your form?


Cancel dragging a component
You're designing a form and you started moving a component by dragging it. Suddenly you realize that you selected the wrong component (or even worse, several components at once). But if you find this error early enough, all is not lost...

If you haven't released the mouse button yet, simply press the Escape key, and the component will jump back to its original position!

Moving a component to an exact spot
Select the component. Press and hold the CONTROL key, then use the cursor keys to move the component in 1 dot increments.

Resizing a component precisely
Select the component. Press and hold the SHIFT key, then use the cursor keys to resize the component in 1 dot increments.

Selecting a component's parent
When designing forms, you often use panels as "containers" to hold other components. But later on, it's sometimes confusing to find out who is the parent of a component... Is it the form that holds a certain edit-box or button, or is there a panel that is "holding" these components?

To quickly find out your component's parent, just select the component whose parent you wish to find and press the Escape key. The procedure can be used repeatedly: finally the ultimate parent, the Form, is selected into the Object Inspector.

This tip is especially useful when a component has been 'Aligned to Client' and its parent cannot be selected easily.

 

DelphiLand Club Members of the DelphiLand Club receive our Crash Course Delphi, plus the fully commented source code of numerous projects, plus guaranteed answers from our Delphi Forum. Membership is for life!

TOP   DelphiLand Club Membership  DC Library  Forum  Forum Archives  Crash Course Delphi  Tips  Source Code  Downloads  Links