Modal forms in an MDI

G

Gwyn

I have a burning desire (need) to dislay either modal
forms or something equivalent within an MDI based
application...

Except I can't! I can use ShowDialog() but the form being
shown cannot have an MDIParent.

I thought, ok, I'll implement it myself... only I can't
work out how the hell I could do it...

I want to achieve the following:

Sub X()

... do some stuff ..
ChildForm.ShowDialog()
... do some more stuff

End Sub

Only I can't use the ShowDialog function so I need to do:

Sub X()

... do some stuff ..
ChildForm.Show()
Stop processing here, let the thread get on with something
else until the ChildForm is Closed
... do some more stuff

End Sub

Now the best anyone's come up with so far is to put a
DoEvents loop in there waiting for the child to be closed
except of course this will burn 100% CPU until the child
is closed. And this is something that always annoys me
about Access cos it does this.

This can't be a new requirement! How does the ShowDialog
work? It must be really quite cunning.. how can I achieve
the same thing?

Thanks in advance
gwyn
 
R

Roger

Hi Gwyn,

I am not a DotNet guru. However, I was not aware that in Win32 a modal
dialog could have the WS_CHILD style. When a modal dialog is created and
displayed, all of the app's top level windows except the dialog are disabled
by the system. If a modal dialog had a parent, the parent and thus the
dialog would be disabled.

-Roger
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top