progging - To wander about and beg; to seek food or other supplies by low arts; to seek for advantage by mean shift or tricks.
progging - Programmer slang for writing computer code.

mandag 29. august 2011

How to clone a Delphi Form

In Visual Studio 2005 it's pretty easy to make a copy of an existing from directly from the project manager in the IDE (simply copy-paste with Ctrl-C and Ctrl-V). This is of course very useful instead of starting from scratch when you have a form that looks a lot like your new form will do.
The trick to do this in Delphi is:

  1. Do a "Save As" of the form in the file menu (.pas and .dfm will be copied and the unit name will be changed)
  2. Edit the saved as form to change the class name (easiest to do it in the designer)
  3. Add back the old form using "Add to Project...(Shift + F11)

Ingen kommentarer:

Legg inn en kommentar