VB 2008 Tutorial - Mouse Locker Tutorial

Use this board to post your code snippets - tips and tricks
11 posts Page 1 of 2
Contributors
User avatar
tvs praveen
Top Poster
Top Poster
Posts: 205
Joined: Tue Dec 08, 2009 6:20 am

Hi, Now i gonna teach you how to do mouse locker with CheckBox within an minute!, To make mouse lock, 1st add 1 CheckBox, 1 Timer

And in Form1_Load Events add this code into it
Code: Select all
KeyPreview = True
First in Properties of the Timer make Enabled = True, And interval into 1
Then double click Timer and add this code into it

Note: To unlock mouse press M, And you can change the key in code! :)
Code: Select all
Cursor.Position = New Point(500, 500)
Now add this code into Form1_KeyDown Events
Code: Select all
        If e.KeyCode = Keys.M Then
            CheckBox1.Checked = False
        End If
Now double click CheckBox and add this code into it
Code: Select all
        If CheckBox1.Checked = True Then
            Timer1.Enabled = True
        Else
            Timer1.Enabled = False
        End If

*******************Thanks for reading my tutorial, I think this Tutorial will be most helpful to you!*******************

If you want any custom tutorial for you or you need any help in VS.NET, VB.NET, Software Coding, Designing and much more any help in Computer stuffs just ask me

Mostly i will help everyone in coding and design stuffs in on Computer

- Best regards hehaho;

- Tvs Praveen wahooo;

- Thanks CodeNStuff! for this amazing Website cooll;
Last edited by tvs praveen on Tue Jan 26, 2010 11:13 am, edited 1 time in total.
Lewis
Coding God
Coding God
Posts: 1564
Joined: Sun Dec 20, 2009 2:12 pm

Tvs, You ask for a code ... and then you put it in here yourself? :L
Image
User avatar
Usman55
VIP - Site Partner
VIP - Site Partner
Posts: 2821
Joined: Thu Dec 24, 2009 7:52 pm

Hey TVS Praveen! I was just about to post the same thing yesterday but I didn't did it because... Actually I had written a little bit of tutorial about it but I thought that you will need to do something like Dim X as Integer, Dim Y as Integer etc. but the mouse thinggy is very easy. Just "Cursor.Position = New Point(500, 500)". I just deleted the whole tutorial because of this! Anyways, I am glad you found it (and shared it!). Thanks.
Image
User avatar
Usman55
VIP - Site Partner
VIP - Site Partner
Posts: 2821
Joined: Thu Dec 24, 2009 7:52 pm

lewisfroom wrote:
Tvs, You ask for a code ... and then you put it in here yourself? :L
He has already told in another section that she has figured it out and he wants to share it with other people to help them!
Image
User avatar
tvs praveen
Top Poster
Top Poster
Posts: 205
Joined: Tue Dec 08, 2009 6:20 am

lewisfroom wrote:
Tvs, You ask for a code ... and then you put it in here yourself? :L

Yes, I figured it out myself, Now i found best code for Mouse Lock, To unlock mouse press M
Lewis
Coding God
Coding God
Posts: 1564
Joined: Sun Dec 20, 2009 2:12 pm

Ohh i see sorry for my mistake
Image
GoodGuy17
Coding God
Coding God
Posts: 1610
Joined: Mon Sep 07, 2009 12:25 am

You are a girl TVS? On-topic: I was trying to figure this out for soooo long since you posted the request and then it's this easy! OMG what a waste of time for me lol Anyways thanks for this.
User avatar
tvs praveen
Top Poster
Top Poster
Posts: 205
Joined: Tue Dec 08, 2009 6:20 am

GoodGuy17 wrote:
You are a girl TVS? On-topic: I was trying to figure this out for soooo long since you posted the request and then it's this easy! OMG what a waste of time for me lol Anyways thanks for this.
No i`m boy :D
User avatar
lesan101
Top Poster
Top Poster
Posts: 193
Joined: Tue Jun 29, 2010 8:10 am

it tells me the "e" in e.keycode is not declared? help?
Image
User avatar
mandai
Coding God
Coding God
Posts: 2585
Joined: Mon Apr 26, 2010 6:51 pm

Are you putting the code in the KeyDown event?
11 posts Page 1 of 2
Return to “Quick Snips”