How can I make a modeless form receive input when a modal form is open?

A

amacd

From my main form, I can open and access a modeless form. However, if I
then open a modal form (from the main form), the modeless form will no
longer accept keyboard and mouse input until the modal form is closed.

Is there a way to allow the modeless form to continue to receive input?

As an example, Windows Notepad does this. If you open the Find dialog,
then open the About box, you can still access the Find dialog.

Any pointers appreciated.

Thanks,
Andrew
 
W

WineNCheese

Perhaps a second thread?

then open a modal form (from the main form), the modeless form will no
longer accept keyboard and mouse input until the modal form is closed.

Is there a way to allow the modeless form to continue to receive input?

As an example, Windows Notepad does this. If you open the Find dialog,
then open the About box, you can still access the Find dialog.

Any pointers appreciated.

Thanks,
Andrew
 
O

Otis Mukinfus

then open a modal form (from the main form), the modeless form will no
longer accept keyboard and mouse input until the modal form is closed.

Is there a way to allow the modeless form to continue to receive input?

As an example, Windows Notepad does this. If you open the Find dialog,
then open the About box, you can still access the Find dialog.

Any pointers appreciated.

Thanks,
Andrew

It works in Notepad because both forms are Modeless. A form can look like a
dialog without being Modeless. Set your Model from to Modeless and set the
FormBorderStyle to FixedDialog and open it with Show, instead of ShowDialog.

Good luck with your project,

Otis Mukinfus
http://www.arltex.com
http://www.tomchilders.com
 
A

amacd

WineNCheese said:
Perhaps a second thread?

Yes, that does work. Unfortunately, the modeless form interacts a fair
bit with the main form, so multithreading would add code complexity I'd
prefer to avoid.

Perhaps someone knows how Microsoft Notepad does it? Could the "Find"
window be running in a separate thread from the main window, or is
there a simpler explanation?

Andrew
 
A

amacd

Otis said:
It works in Notepad because both forms are Modeless. A form can look like a
dialog without being Modeless. Set your Model from to Modeless and set the
FormBorderStyle to FixedDialog and open it with Show, instead of ShowDialog.

I tried your suggestion, but the (previously modal) form operates like
a normal modeless form with those changes. That is, I can still access
the main form.

That isn't the case with Notepad, which prevents access to the main
window when the About Box is open.

As another example, the "Find" window is also still accessible when the
(apparently) modal "File Open" message box is open.

Andrew
 
O

Otis Mukinfus

I tried your suggestion, but the (previously modal) form operates like
a normal modeless form with those changes. That is, I can still access
the main form.

That isn't the case with Notepad, which prevents access to the main
window when the About Box is open.

As another example, the "Find" window is also still accessible when the
(apparently) modal "File Open" message box is open.

Andrew

To quote you in your previous post: "As an example, Windows Notepad does this."

Did you not know you can still access Notepad while the Modeless Find dialog is
open?

Sorry I thought you wanted it to work like Notepad.
Good luck with your project,

Otis Mukinfus
http://www.arltex.com
http://www.tomchilders.com
 
O

Otis Mukinfus

On 11 May 2006 10:19:12 -0700, (e-mail address removed) wrote:

[snip]
I tried your suggestion, but the (previously modal) form operates like
a normal modeless form with those changes. That is, I can still access
the main form.

That isn't the case with Notepad, which prevents access to the main
window when the About Box is open.

As another example, the "Find" window is also still accessible when the
(apparently) modal "File Open" message box is open.

Andrew

Oops! I didn't read your example clearly. Sorry.
Good luck with your project,

Otis Mukinfus
http://www.arltex.com
http://www.tomchilders.com
 

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

Top