When using the Delphi form designer, developers tend to use the mouse a lot. But there are a few keyboard shortcuts that I find particularly useful:

Esc selects the parent control of the currently selected control

This is especially useful if you’ve got a container (often a TPanel or similar) that doesn’t have any visible area because its children fill the entire container (for instance, if it contains a control which is aligned alClient). You can just select the child control, then hit Esc, and the parent control will be selected.

Ctrl+Drag selects a group of components without selecting/moving the parent

Everyone probably knows that you can drag the mouse to select multiple components, then move them, edit their common properties, etc. But what if those components are children of another control. Trying to click+drag would just select and then move the parent.

Ctrl+Drag solves this. Hold down the Ctrl key, then click and drag, and the components in the focus box will be selected, but the form design won’t attempt to select or move the parent that you clicked on.

(OK, that one still uses the mouse, but it solves a frustrating problem)

Shift+Arrows resizes controls

Resizing controls is often done with the mouse, grabbing the control’s resize handles and sizing appropriately. But it’s tough to get pixel-perfect precision with the mouse, and be default the form designer always uses “the grid” when sizing with the mouse.

Instead, you can resize the selected control(s) with the arrow keys by holding down the Shift key. The Up/Down keys will resize the height of the control in one-pixel increments, and the Left/Right keys change the width.

Ctrl+Arrows moves controls

Similar to resizing, moving controls with the mouse doesn’t always yield pixel-perfect precision. Using the Ctrl key with the arrow keys moves the selected control(s) in one-pixel increments.

P.S. Using the arrow keys without Shift or Ctrl changes the selected component.

Want to take your Delphi IDE to the next level? Get Castalia – a smarter code editor, integrated right into your Delphi IDE.