CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2000
    Posts
    440

    button and events


    Given a dialog with several buttons. Default behavior is when user press arrow keys to move the focus between them (buttons). However I need to override this behavior. I need to change it so that when user press arrow keys to call my function that will do something (moving this window etc). It seems that when I catch the keypress event it catch all keys except arrow keys, enter tab etc. I need to catch arrow keys.
    Any idea?

    Valery Iskarov Nikolov
    http://listen.to/quark

  2. #2
    Join Date
    Dec 1999
    Location
    Dublin, Ireland
    Posts
    1,173

    Re: button and events

    You could Subclass the window proc of your dialog and perform this operation when you recieve a WM_KEYDOWN and WM_KEYUP messages.

    There are a number of code samples on this technique or you could download the EventVB.OCX from http://www.merrioncomputing.com/Download/index.htm and drop a VBEventWindow control on your form and then set it's ParentWnd member and put your code in it's WindowMessage() event.

    HTH,
    Duncan

    -------------------------------------------------
    Ex. Datis: Duncan Jones
    Merrion Computing Ltd
    http://www.merrioncomputing.com
    Check out the new downloads - EventVB.OCX for adding new events to your VB form and adding System Tray support simply, MCL Hotkey for implemenmting system-wide hotkeys in your application...all with source code included.
    '--8<-----------------------------------------
    NEW -The printer usage monitoring application
    '--8<------------------------------------------

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