|
-
Oct 20th, 2011, 01:15 PM
#1
Thread Starter
New Member
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
-
Oct 20th, 2011, 02:54 PM
#2
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
 
-
Oct 21st, 2011, 04:04 AM
#3
Thread Starter
New Member
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
-
Oct 21st, 2011, 08:43 AM
#4
Thread Starter
New Member
-
Oct 21st, 2011, 08:52 AM
#5
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
 
-
Oct 21st, 2011, 09:02 AM
#6
Addicted Member
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.
-
Oct 21st, 2011, 10:28 AM
#7
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|