ShowDialog() problem

  • Thread starter Thread starter Mike
  • Start date Start date
M

Mike

Hi,

I want to show form as a modal dialog and use such code:
Dim frm_Zip As New frmZIP
frm_Zip.ShowDialog()

but instead of be as modal dialog, it is modeless - I can switch between forms.

Does anybody had the same problem?
OS: Win2000 Prof

Thanks
 
You need to specify the parent form in the ShowDialog call such as

frm_Zip.ShowDialog(Me)

to show as modal dialog for the current form
 
Hi,

I want to show form as a modal dialog and use such code:
Dim frm_Zip As New frmZIP
frm_Zip.ShowDialog()

but instead of be as modal dialog, it is modeless - I can switch between forms.

Does anybody had the same problem?
OS: Win2000 Prof

Thanks

Strange. ShowDialog *does* create a modal dialog.

Are you calling this from a seperate thread?

// CHRIS
 
* (e-mail address removed) (Mike) scripsit:
I want to show form as a modal dialog and use such code:
Dim frm_Zip As New frmZIP
frm_Zip.ShowDialog()

but instead of be as modal dialog, it is modeless - I can switch between forms.

Does anybody had the same problem?
OS: Win2000 Prof

Should work. Where do you use the code?
 
* "Scott said:
You need to specify the parent form in the ShowDialog call such as

frm_Zip.ShowDialog(Me)

to show as modal dialog for the current form

Even calling it without specifying the form should show it modally.
 
Yes, the main form and dialog in different threads.

The scenario:

Main window create a new class and run it as a separate thread.
From that class I call ShowDialog.

Does it matter something? Because it is the same application , not separate
exe or dll module.

Thanks
 
Back
Top