1. Home
  2. Computing & Technology
  3. Delphi Programming

Reposition Inherited Control Back to Its Original Position
Revert To Inherited in Delphi

By , About.com Guide

delphi ide - revert to inherited

delphi ide - revert to inherited

In Delphi, when a form inherits from another form using VFI (visual form inheritance) all controls on the base form exist on the inherited form with their properties "copied" from the ancestor.

When you change any of the properties of a control on the base form, for example, Color - the color of this control on the inherited form will also change. This is in the heart of Delphi's visual form inheritance. You have inheritance that is visual.
Move the control on the base form - the control is repositioned on the inherited form (to match the position of its ancestor)!

In complex form designs you might, with a purpose or accidentally, change properties of the inherited control: position, color, size, etc.

What if you need to "undo" the changes? How to make sure that the inherited control again looks and feels like the original?

Revert To Inherited - Control Context Menu Option

For example, if a form inherits a certain button placement and size from another form and you then move the button, how do you put it "back"?

Here's how:

  1. Open up the inherited form in designer,
  2. Locate the control that you want to "revert to inherited"
  3. Right-click the control,
  4. From the context menu, select "Revert to Inherited".
Revert To Inherited returns the button to its original position and size. Note: this action restore the inherited control to its original state (as it is on the base form).

Delphi tips navigator:
» Hijack consts.pas to have Country / Language Specific Messages
« Get the Application associated with the Shell Print Command for a File Type from Delphi

More Delphi Programming Quick Tips
Explore Delphi Programming
About.com Special Features

Reader's Choice Award Winners

What are the best instant messengers, apps, editors and more? You told us, for our 2010 technology awards program. More >

iPad Central

Is Apple's new tablet computer impractical, a must-have -- or both? We'll help you figure it out. More >

  1. Home
  2. Computing & Technology
  3. Delphi Programming
  4. Coding Delphi Applications
  5. Delphi Tips and Tricks
  6. Delphi 2008 Tips
  7. Reposition Inherited Control Back to Its Original Position - Revert To Inherited in Delphi IDE

©2010 About.com, a part of The New York Times Company.

All rights reserved.