Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. get no cursor-key-down-event in mdi-app

get no cursor-key-down-event in mdi-app

Scheduled Pinned Locked Moved C#
dockerquestion
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    Rupel
    wrote on last edited by
    #1

    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

    J 1 Reply Last reply
    0
    • R Rupel

      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

      J Offline
      J Offline
      James T Johnson
      wrote on last edited by
      #2

      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!

      R 1 Reply Last reply
      0
      • J James T Johnson

        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!

        R Offline
        R Offline
        Rupel
        wrote on last edited by
        #3

        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

        J 1 Reply Last reply
        0
        • R Rupel

          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

          J Offline
          J Offline
          James T Johnson
          wrote on last edited by
          #4

          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!

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups