Mega Code Archive

 
Categories / Delphi / Ide Indy
 

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

Title: Reposition Inherited Control Back to Its Original Position - Revert To Inherited in Delphi IDE 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: Open up the inherited form in designer, Locate the control that you want to "revert to inherited" Right-click the control, 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).