Handling KeyPress when IsMdiContainer = true

  • Thread starter Thread starter Sorawit Sharp
  • Start date Start date
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
 
Hi,

Not sure this works for MDI forms, but you can try to set the KeyPreview
property to "true".
 
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
 
Back
Top