[V8i VBA] Assign Keyboard Arrow Keys to VBA form buttons.

Hi!

I would like to have North, South, East and West movement defined by a form button and a keyborad arrow key.  Is it possible to assign keyboard arrow keys to VBA form buttons?

Parents Reply
  • Windows Messages

    When you press a key on your computer, you generate a Windows message. That message is routed to the currently active application.

    The above is out of MicroStation's control. It's out of the control of any normal Windows application. However, the application is responsible for routing the message to the user interface component that it considers to be active.  If you were to write code using the Win32 API then you could intercept a message, and use that message to do whatever you want.  To extend Jan's comment, you could divert a keypress message from the widget that has focus to some other code. However, that is a complex process.

    To understand how complex that process can be, visit a website that deals with Win32 or Microsoft Foundation Class (MFC) programming.

    Microsoft designed VBA to be simple to use. They took out lots of the internal stuff, such as Windows messaging, to make it easy to write code in VBA. More accurately, the VBA UserForm so completely wraps Windows messaging as to make it invisible to the programmer.  As a result, it's hard to do what you want with a VBA application.

     
    Regards, Jon Summers
    LA Solutions

Children
No Data