How to supress Ctrl-F6?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

My MDI form has several child forms in maximized state. Pressing Ctrl-F6
causes next child to show, which I don't like. How can I cancel standard
Ctrl-F6 behaviour?
Thank you
 
Alex,

You should be able to hook into the KeyDown event on the main form, and
detect the modifier that is pressed at the same time (the ctrl key). You
should be able to cancel this event.

If that doesn't work, then you can always override the WndProc method on
the main form and then handle the key events there (by handling the windows
message yourself).

Hope this helps.
 
My MDI form has several child forms in maximized state. Pressing Ctrl-F6
causes next child to show, which I don't like. How can I cancel standard
Ctrl-F6 behaviour?

See Nicholas' earlier post on some options to do what you want.

However, you might like to consider that, unless you are writing
applications *only for yourself*, what you like and dislike is largely
irrelevant. Ctrl-F6 is the standard keystroke for moving between child forms
in MDI apps (as you know), so any of your users who've ever used such an app
(e.g. Word, Excel etc) will fully expect to be able to use that keystroke in
your app too, otherwise they might move to another vendor's solution whose
usage is more intuitive to them.

Just a thought...
 
KeyDown on main form does not work: it is not fired when ctrl-F6 pressed.
Now I am trying to catch it in WndProc

Thanks

Nicholas Paldino said:
Alex,

You should be able to hook into the KeyDown event on the main form, and
detect the modifier that is pressed at the same time (the ctrl key). You
should be able to cancel this event.

If that doesn't work, then you can always override the WndProc method on
the main form and then handle the key events there (by handling the windows
message yourself).

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Alex K. said:
My MDI form has several child forms in maximized state. Pressing Ctrl-F6
causes next child to show, which I don't like. How can I cancel standard
Ctrl-F6 behaviour?
Thank you
 
I wrote "I don't like" just to indicate my problem. For my application it is
absolutely critical to avoid standard MDI behaviour because it appears to
user as a normal single form interface. (only one child is visible at any
particular moment and MDI parent controls the switching between childs based
on functions executed by user).
So don't worry about me losing clients: the app is developed by their specs.

BTW, from options suggested by Nicholas, none seem to work. So, I am still
looking for the right answer...

Thank you
 
Alex,

What messages are you looking for in WndProc? There has to be SOME
message that is handling this, you just have to find the right one.

Also, are you calling the base implementation before or after you check
the message in WndProc?
 
I've found the solution.
Message is WM_SYSCOMMAND = 0x112,
and WndProc must be defined in all child forms, but not in MDI paremt form.

Finally, it works!
Thank you



Nicholas Paldino said:
Alex,

What messages are you looking for in WndProc? There has to be SOME
message that is handling this, you just have to find the right one.

Also, are you calling the base implementation before or after you check
the message in WndProc?

--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Alex K. said:
I wrote "I don't like" just to indicate my problem. For my application it
is
absolutely critical to avoid standard MDI behaviour because it appears to
user as a normal single form interface. (only one child is visible at any
particular moment and MDI parent controls the switching between childs
based
on functions executed by user).
So don't worry about me losing clients: the app is developed by their
specs.

BTW, from options suggested by Nicholas, none seem to work. So, I am still
looking for the right answer...

Thank you
 
Back
Top