473,385 Members | 1,387 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Modal forms in an MDI

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
Jul 21 '05 #1
1 1505
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

"Gwyn" <an*******@discussions.microsoft.com> wrote in message
news:00****************************@phx.gbl...
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

Jul 21 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: cassidyc | last post by:
Hi, I was wondering if anyone has come accross this issue? And if they have any solutions I have that can create new copies of itself Form1 as = new form1(); af.show(); This form can also...
8
by: Stephen Rice | last post by:
Hi, I have a periodic problem which I am having a real time trying to sort. Background: An MDI VB app with a DB on SQL 2000. I have wrapped all the DB access into an object which spawns a...
2
by: Mike | last post by:
Hi, I'm having a problem with modal forms on windows. I've written a very short test program, with a main window and a form called from the main window. The form is set to modal with...
2
by: diogenes | last post by:
I have created many shortcut/popup (aka context, or right-click) menus for my application - instead of toolbars or standard drop-down menus. Within my custom menu, I am using...
4
by: =?Utf-8?B?Z2luYWNyZXNzZQ==?= | last post by:
I am trying to close/dispose multiple instances of a form but because they are modal and hidden, they do not show up in My.Application.OpenForms. They must be modal, so making them modeless is not...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.