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
Printable View
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
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.
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
bump
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?
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.
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