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

Thread: Mouse Trap

  1. #1
    Join Date
    Jun 2001
    Location
    Haryana,India
    Posts
    8

    Mouse Trap

    Hi,
    I have a MS FLexgrid on my Form.
    I am looking for the code which makes mouse to behave in the same
    manner as it works on Windows Platform.
    I know how to trap the Right click button and left click and the middle click.
    I have "scroll Mouse" so like in ms-excel when you click the scroll button and move
    the mouse in any direction the sheet automatically moves in that direction.
    I am trying to give the same functionality to my application.

    Your help is appreciated. Thanks in Advance.

    Deepak Adlakha.



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

    Re: Mouse Trap

    You will need to find out what message the scroll mouse sends to your application and then put your code in that.

    The handiest way of doing that is to download the EventVB.ocx from http://www.MerrionComputing.com/Download/index.htm , drop the EventWindow control from that OCX on a form and put the following code in that form:


    private Sub Form_Load()
    VBEventWindow1.ParentForm = me.hWnd
    End Sub




    and put code to see what messages are sent to your form:

    private Sub VBEventWindow1_WindowMessageFired(byval msg as WindowMessages, byval wParam as Long, byval lParam as Long, Cancel as Boolean, ProcRet as Long)

    Debug.print msg & " ( " & wParam & " , " & lParam & " )"

    End Sub




    Hope this helps,
    Duncan

    -------------------------------------------------
    Ex. Datis: Duncan Jones
    Merrion Computing Ltd
    http://www.merrioncomputing.com
    Check out the new downloads - ImageMap.ocx is the VB control that emulates an HTML image map, 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