Tips for using in the IDE  

Send By: Radikal (Q3 Team)
Web :
Date: 18/01/00

Tip accessed 676 times


For sure in a same way that me... you didn't give importance to the help of Delphi, jumping you the chapter of the IDE and their utilities to make your more comfortable life.
Here you have a series of utilities that if you remember them, they will make your proggramer life much more comfortable:

Putting componens in your form

The traditional way

The better known one: You make click on the component in the Palette and then you make click on the component of the form that will be the father of the new component (for example, on a panel or on the own form).
This way, we will put a component of predetermined size.

Other, similar of well-known

The classic way to define components of a size different to the one predetermined: Click on the components palette, and drag with the mouse on the component father with the left button of the mouse pressed.

A less well-known but useful one:

Double click on the component in the component palette: we will add a new control, of predetermined size that will have how father to the active component in that moment, and it will be located in the component father's center.

Put several controls of the same type

Simply make click on the component in the Palette, having pressed the Shift. Then to make click on the component father so many times like components wants, and to conclude, simply to make click on the arrow located to the left, in the palette of components.

Likewise, for sure at some time it has happened to you the same thing that to my: to want to move or redimensionate a component, two or three pixels and to finish making writing it directly the value in their properties Left, Top, Width and Height... so Delphi also has solutions for this:

Moving/Redimensionating components

CTRL+Cursor keys

Move the active component pixel by pixel

Shift+Cursor keys

Redimensionate the active component, pixel by pixel


It is good to select the father of the active control. Very useful when we want to select the form (for example to go to the OnCreate event) and we have it completely covered by components.

On the other hand, here you have some keyboard accelerators that will allow to maintain your readable code with less effort:

Indenta a code block

It will have happened you thousands of times: to be writing code and suddenly pensarr that several lines of code they should be inside an if, and therefore, inside the corresponding Begin ...End, and therefore, to have to penetrate the code so that it maintains a correct aspect.
Before knowing this keyboard accelerator, I spent a good while adding tabs with the help of repeating Home->tab->Cursor down :)
So... it is as simple as to select the you line that you want to indent and to press CTRL+Shift+I
Prove it and I assure you that you won't forget him...:)

De-Indent a code block

The opposed operation: you have eliminated an if and you have several lines of code with some spaces of more...
Simply, selects the lines and press CTRL+Shift+U

I wait that your you understand my poor English... of not being this way... please send me your corrections...

 unit Unit1;
 Type TToto = class(TTiti)
   property Edad: Integer read ;
   procedure Algo;



Te pones sobre una declaracion del interface (por ejemplo encima de procedure) y apretas CTRL+SHIFT+C y te encuentras con lo siguiente

 unit Unit1;
 Type TToto = class(TTiti)
   property Edad: Integer read FEdad write SetEdad;
   procedure Algo;
     FEdad: Integer;
     procedure SetEdad(const Value: Integer);


 { TToto }

 procedure TToto.Algo;


 procedure TToto.SetEdad(const Value: Integer);
   FEdad := Value;


Updated at 22/12/99:

Other send by Arturo Garc´┐Ża:

Select text in vertical

Press CTRL+ALT and select a region with the mouse.

Updated at 18/01/2000:

Other send by Eber Sys:

Aqui estan algunos trucos mas, yo uso la version 5 de delphi, no se si esten disponibles en versiones anteriores.

para seleccionar texto por columnas:

  presiona Ctrl+O, C

despues de eso cada vez que selecciones estaras en el modo select by columns para volver al modo normal simplemente selecciona un texto con el mouse

Para cambiar el CharCase de un texto:

 selecciona el texto y presiona Ctrl+o, U

por ejemplo si el texto es "CharCase" quedara como "cHARcASE"

para cambiarte rapido de tu form a tu codigo presiona F12, muy util cuando se te olvida el nombre de los componentes

Para mover texto a la Izquierda-Derecha; selecciona el texto y presiona:

 Izquierda: Ctrl+K, U
 Derecha: Ctrl+K, I

Tambien puedes personalizar los codigos que aparecen con Ctrl+J, en el menu de Tools, Editor Options, Code Insight