0
votes

We are upgrading a Delphi 5 application to Delphi XE7. The application has a number of MDIChild (FormStyle fsMDIChild) forms which open with WindowState wsNormal. When I open one of these forms, and close it again, my main menu (TMainMenu) on the main form (FormStyle fsMDIForm) aligns itself to the right and never goes back again. If I resize the MDIChild form before closing it (eg. click on "Normal" or "Minimize" icon), this does not happen.

This does not happen with the Delphi 5 version, so I assume something gets handled differently with XE 7.

Anyone else experienced this before? If so, how did you fix it?

UPDATE:

I have successfully replicated this problem:

  1. Create a new VCL app
  2. Make main form (MainForm) formStyle MDIForm
  3. Create MainMenu for MainForm with menu items
  4. Create second form (ChildForm)
  5. Make ChildForm formStyle MDIChild
  6. Create MainMenu for ChildForm with menu items
  7. IMPORTANT (THIS IS WHAT BREAKS IT): Select for ChildForm BorderIcons only biSystemMenu and biMaximise
  8. Create button on MainForm which creates and shows ChildForm
  9. Run application
  10. Click button
  11. Maximise ChildForm
  12. Close ChildForm (Has to be maximised otherwise malfunction does not occur)
  13. Observe that MainForm's menu is now right-aligned with an unclickable 'Minimise' icon on the left If biMinimise is added to ChildForm's BorderIcons, the problem disappears.

I'm pretty sure this is a bug. Correct me if I'm wrong.

Thanks J

1

1 Answers

1
votes

The behaviour that you report is not observed when creating a brand new project, and creating forms in the manner that you describe.

Clearly then, there is some code in your project that is causing this issue. You need to do some debugging to identify this problem code. Start by stripping code away until the issue vanishes. The last code that you stripped away should contain the clues to lead you to the cause of thee problem. Continue in this manner until you have isolated the problem.