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

Thread: Mouse Click

  1. #1
    Guest

    Mouse Click

    sir
    Can we activate a window message artificialy e.g mouse click
    Niaz



  2. #2
    Join Date
    Jun 1999
    Location
    Switzerland
    Posts
    58

    Re: Mouse Click

    Hi,

    What do you want exactly?
    Do you want to have a message come up after you clicked e.g. a form window in VB?

    A simple reply would be

    Private Sub Form_Click()
    MsgBox "Text........"
    End Sub

    Otherwise provide more details.

    Jan


  3. #3
    Join Date
    May 1999
    Location
    Omika, Japan
    Posts
    729

    Re: Mouse Click


    Yes. You can synthesise a mouse or keyboard event with mouse_event and keybd_event. But this works on WinNt only. and also MSDN says oflate you should use SendInput APi. NT-specific.

    In vb, if you just want to do what you do on a event, mouse click - for example, you can call that function directly in code.
    Private sub Form_Click()
    ... some things happens here
    end sub
    You want the same thing to happen even if a btn is clicked, say, then
    Private sub Command1_Click()
    call Form_Click()
    end sub
    Check if this kind of thing is sufficient for your case.

    RK


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