Usercontrol don't raises keyDown event

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Ronchese

    #1

    Usercontrol don't raises keyDown event

    Hi All.

    I'm developing a usercontrol that have no controls inside him, just showing
    scrollbars when needed. All the rest of interface is done with graphics
    object.

    The problem is, now I need to capture keyboard events inside the control,
    but it not raises so I can work with the keys.

    (for sample, if there are scrollbars visible and I press
    Up/Left/Right/Bottom keys, a scrollbar get focus. If there are no scrollbars
    visible, the focus is transfered to next control of the form that is hosting
    my usercontrol)

    How can I fix that?

    Ps.: I'm using Framework 1.1


    []s
    Cesar


  • Ronchese

    #2
    Re: Usercontrol don't raises keyDown event

    Found it! Just needed override the IsInputKey() method and it is done!

    []s
    Cesar



    "Ronchese" <ronchese@smlin fo.com.br> escreveu na mensagem
    news:OOPlWqwtFH A.3252@TK2MSFTN GP10.phx.gbl...
    Hi All.

    I'm developing a usercontrol that have no controls inside him, just showing
    scrollbars when needed. All the rest of interface is done with graphics
    object.

    The problem is, now I need to capture keyboard events inside the control,
    but it not raises so I can work with the keys.

    (for sample, if there are scrollbars visible and I press
    Up/Left/Right/Bottom keys, a scrollbar get focus. If there are no scrollbars
    visible, the focus is transfered to next control of the form that is hosting
    my usercontrol)

    How can I fix that?

    Ps.: I'm using Framework 1.1


    []s
    Cesar



    Comment

    • Ronchese

      #3
      Re: Usercontrol don't raises keyDown event

      Found it! Just needed override the IsInputKey() method and it is done!

      []s
      Cesar



      "Ronchese" <ronchese@smlin fo.com.br> escreveu na mensagem
      news:OOPlWqwtFH A.3252@TK2MSFTN GP10.phx.gbl...
      Hi All.

      I'm developing a usercontrol that have no controls inside him, just showing
      scrollbars when needed. All the rest of interface is done with graphics
      object.

      The problem is, now I need to capture keyboard events inside the control,
      but it not raises so I can work with the keys.

      (for sample, if there are scrollbars visible and I press
      Up/Left/Right/Bottom keys, a scrollbar get focus. If there are no scrollbars
      visible, the focus is transfered to next control of the form that is hosting
      my usercontrol)

      How can I fix that?

      Ps.: I'm using Framework 1.1


      []s
      Cesar



      Comment

      Working...