Handling KeyPress when IsMdiContainer = true

S

Sorawit Sharp

I created a windows form MDI application and want to handle function keys in
the KeyPress and KeyUp handlers.

The handlers are not being called unless I change the application to a SDI
application by setting the form property IsMdiContainer = false.

Anyone has a hint how to handle keys in a MDI application.



Sorawit
 
D

Dmitriy Lapshin [C# / .NET MVP]

Hi,

Not sure this works for MDI forms, but you can try to set the KeyPreview
property to "true".
 
S

Sorawit Sharp

That's the solution, thanks.
Sorawit
Dmitriy Lapshin said:
Hi,

Not sure this works for MDI forms, but you can try to set the KeyPreview
property to "true".

--
Sincerely,
Dmitriy Lapshin [C# / .NET MVP]
Bring the power of unit testing to the VS .NET IDE today!
http://www.x-unity.net/teststudio.aspx

Sorawit Sharp said:
I created a windows form MDI application and want to handle function
keys
in
the KeyPress and KeyUp handlers.

The handlers are not being called unless I change the application to a SDI
application by setting the form property IsMdiContainer = false.

Anyone has a hint how to handle keys in a MDI application.



Sorawit
 

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