CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: General KeyDown

  1. #1
    Join Date
    Mar 2001
    Location
    Tel Aviv, Israel
    Posts
    78

    General KeyDown

    Hi !

    How do you make a funcion respond to a ceratin key (say 'D') without relation to what control has got the focus ?
    I mean - without using the different controls\forms KeyDown events.

    Thanks,

    Oren.


    ~&-)

  2. #2
    Join Date
    Jul 2000
    Location
    Milano, Italy
    Posts
    7,726

    Re: General KeyDown

    set the keypreview property of a form to true
    The form will receive the keystroke before controls
    Then you can code calls to subs or functions in keypress, keydown, keyup events of the form

    Special thanks to Lothar "the Great" Haensler, Tom Archer, Bruno Paris and all the other wonderful people who made and make Codeguru a great place. Come back soon, you Gurus.
    ...at present time, using mainly Net 4.0, Vs 2010



    Special thanks to Lothar "the Great" Haensler, Chris Eastwood , dr_Michael, ClearCode, Iouri and
    all the other wonderful people who made and make Codeguru a great place.
    Come back soon, you Gurus.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured