Results 1 to 7 of 7

Thread: Virtual Form Mouse

  1. #1

    Thread Starter
    New Member
    Join Date
    Oct 2011
    Posts
    14

    Virtual Form Mouse

    Hey guys I am developing a project in which I need to create kind of like a virtual mouse within the form that can move around the form and click buttons and such without taking control of the person's mouse.

    is this possible to do

  2. #2
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    40,106

    Re: Virtual Form Mouse

    Sounds like a floating picturebox with a largely transparent background. That can wander around the screen easily enough, I just don't know whether it will go in front of, or behind, buttons. It should work ok, though. I assume that what you are thinking of is something like an automated demo display, because there does become a minor difficulty if you want the user to be able to decide where and when to click.
    My usual boring signature: Nothing

  3. #3

    Thread Starter
    New Member
    Join Date
    Oct 2011
    Posts
    14

    Re: Virtual Form Mouse

    They options are preset like they click a button and the virtual mouse takes over and navigates throughout the form without takiing control of the persons mouse.

    Do you know any code which could do this

  4. #4

    Thread Starter
    New Member
    Join Date
    Oct 2011
    Posts
    14

    Re: Virtual Form Mouse

    bump

  5. #5
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    40,106

    Re: Virtual Form Mouse

    You can make a picturebox control and move it here and there. Having it simulate a click will not be so elegant. You could call the click event handler directly, or you could move everything in the click event handler off into a different sub and have that be called wherever needed.

    What ends up happening is that you will be creating a scripted sequence of actions. Some of the actions will be to move the picturebox around the screen, while other actions will be to call the right methods when you get to a certain location. Making this look right will take some effort, because you need the fake cursor to move slow enough that people can see it, while moving fast enough that people don't fall asleep. There isn't any simple way to do this, it will take a certain amount of trial and error.

    What is this for, a demo?
    My usual boring signature: Nothing

  6. #6
    Addicted Member Joshlad's Avatar
    Join Date
    May 2011
    Location
    England
    Posts
    160

    Re: Virtual Form Mouse

    I understand what hiker is saying,
    picturebox that looks like mouse
    code the move to button.
    when move stops just execute what was in the button.
    repeat.

    Create each button like normal and than create a Begin_Sequence sub, which just handles mouse move, event, mouse move.

  7. #7
    PowerPoster boops boops's Avatar
    Join Date
    Nov 2008
    Location
    Holland/France
    Posts
    3,201

    Re: Virtual Form Mouse

    Using a picture box won't work because the transparent bits will only show the background of the form, not its controls. You need to put your cursor image on a separate form. Set its BackgroundColor and TransparencyKey to the same color, BorderStyle to None and ShowInTaskbar to False. Show the cursor form with the Owner argument: CursorForm.Show(Me). Finally, set the cursor form's XY position relative to the screen instead of to the main form.

    BB

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