get no cursor-key-down-event in mdi-app
-
hi, strange thing this: i have an mdi-app and want to scroll the child-windows by use of the cursor-keys (which is kind of natural to me and a few others) ;). but i get no key-down-event for the cursor-keys in my mdi-child. i have played around a lot with the following results: in non-mdi-environments (simple form) everything is ok (compare to petzold: chapter 6, SysInfoKeyboard) :) switching back to mdi: even in the mdi-parent form (the outer "container") i get no Keys.Up/Down/Left/Right - messages. but only if there's no modifier pressed. means: "ctrl-up" or "alt-down" do reach the child-window :eek:, but it seems that someone blocks the simple cursor-key-pressed-events, when i enable the IsMdiContainer-property of the main form. :omg: anyone any idea? :wq
-
hi, strange thing this: i have an mdi-app and want to scroll the child-windows by use of the cursor-keys (which is kind of natural to me and a few others) ;). but i get no key-down-event for the cursor-keys in my mdi-child. i have played around a lot with the following results: in non-mdi-environments (simple form) everything is ok (compare to petzold: chapter 6, SysInfoKeyboard) :) switching back to mdi: even in the mdi-parent form (the outer "container") i get no Keys.Up/Down/Left/Right - messages. but only if there's no modifier pressed. means: "ctrl-up" or "alt-down" do reach the child-window :eek:, but it seems that someone blocks the simple cursor-key-pressed-events, when i enable the IsMdiContainer-property of the main form. :omg: anyone any idea? :wq
If you override IsInputKey/IsInputChar do you still see that problem? Try overriding it in the MDI child first, then in the parent, then in both. HTH, James Simplicity Rules!
-
If you override IsInputKey/IsInputChar do you still see that problem? Try overriding it in the MDI child first, then in the parent, then in both. HTH, James Simplicity Rules!
man, what are you doing? editor for the class-library-documentation? ;) the following seems to work, inserted in the child-window-class
protected override bool IsInputKey(Keys data)
{
return true;
}at least in my little test-app. i will try in the real project in a minute. thx! :rose: ----------- edit: did it a bit safer in the real project
// overriden to get the cursor-key-events
protected override bool IsInputKey(Keys data)
{
bool ret = base.IsInputKey(data);
if (data==Keys.Up || data==Keys.Down || data==Keys.Left || data==Keys.Right)
return true;
else
return ret;
}nevertheless - it works. :wq
-
man, what are you doing? editor for the class-library-documentation? ;) the following seems to work, inserted in the child-window-class
protected override bool IsInputKey(Keys data)
{
return true;
}at least in my little test-app. i will try in the real project in a minute. thx! :rose: ----------- edit: did it a bit safer in the real project
// overriden to get the cursor-key-events
protected override bool IsInputKey(Keys data)
{
bool ret = base.IsInputKey(data);
if (data==Keys.Up || data==Keys.Down || data==Keys.Left || data==Keys.Right)
return true;
else
return ret;
}nevertheless - it works. :wq
Rüpel wrote: man, what are you doing? editor for the class-library-documentation? LOL, no nothing quite as nice as that; I just have a knack for remembering programming related things. Unfortunately 90% of the time I can't remember what I said 5 minutes after I say it :-P James Simplicity Rules!