GoldenEye4ever
Programmer
I'v written a "Windows VLC Forms" app consisting of roughly 10 separate Windows Forms.
I'm having a strange issue with using both the: "ShowMessage(...)" and "MessageDlg(...)" functions.
If I call either function from any Form, other than Form1 (the initial form in the VLC application), Form1 is given focus.
Steps to replicate issue:
- User navigates to Form2 (or any Form other than Form1)
- User clicks the "Save" button
- Form1 is given focus (this is the issue)
- MessageDlg(...) dialog is presented, and is given focus over Form1
- However, Form1 is still visible over Form2
- Once user closes MessageDlg(...) dialog, either by clicking one of the buttons or the "X", Form1 regains focus
My attemp to combat this issue:
- In my code, immediately following each instance of "ShowMessage(...);" and "MessageDlg(...);", I've added "Form2.focus();".
- However, this only restores focus to the correct Form after the dialog is closed.
Form1 is still covering Form2 while either dialog is visible
Please help
This weird issue happens both on XP and VISTA.
I initially developed my code in XP, using TurboDelphi.
However, I've re-compiled in VISTA using both "Delphi 2007" and "Delphi 2009 trial" to no avail
I'd be open to using custom Dialog boxes if anyone knows of any that work well
I'm having a strange issue with using both the: "ShowMessage(...)" and "MessageDlg(...)" functions.
If I call either function from any Form, other than Form1 (the initial form in the VLC application), Form1 is given focus.
Steps to replicate issue:
- User navigates to Form2 (or any Form other than Form1)
- User clicks the "Save" button
- Form1 is given focus (this is the issue)
- MessageDlg(...) dialog is presented, and is given focus over Form1
- However, Form1 is still visible over Form2
- Once user closes MessageDlg(...) dialog, either by clicking one of the buttons or the "X", Form1 regains focus
My attemp to combat this issue:
- In my code, immediately following each instance of "ShowMessage(...);" and "MessageDlg(...);", I've added "Form2.focus();".
- However, this only restores focus to the correct Form after the dialog is closed.
Form1 is still covering Form2 while either dialog is visible
Please help
This weird issue happens both on XP and VISTA.
I initially developed my code in XP, using TurboDelphi.
However, I've re-compiled in VISTA using both "Delphi 2007" and "Delphi 2009 trial" to no avail
I'd be open to using custom Dialog boxes if anyone knows of any that work well