TManagedFormConnEditForm Class

The TManagedFormConnEditForm class descends from TManagedForm and makes the ConnectionString dialog sizeable for all Delphi versions. It has a protected method MakeComponentsResizable that overrides the empty method of the ancestor class, and two private methods:

  • MakeComponentsResizable changes the Anchor property of all controls to make them move in a sensible way. In addition it hooks the OnClick event of the “Build …” button to call the private BuildButtonClick method. (todo: Move the latter to the DoFixFormErrors method.)
  • BuildButtonClick intercepts the click on the “Build …” button and calls the private EditConnectionString method for editing the connection string.
  • EditConnectionString fixes a Windows bug where the build dialog is not centered on the parent handle when the parent dialog is not on the primary monitor. It does that by starting a background thread that searches for the dialog and moves it to the correct place.