Log inUsernamePassword
Log me on automatically each visit    
Register
Register
Log in to check your private messages
Log in to check your private messages
Visual Basic Forum for Visual Basic Programmers VB Forum Index » Knowledge Base

Post new topic   Reply to topic
Show / Hide Mouse Cursor
View previous topic :: View next topic  
Author Message
Avis
Junior Poster


Joined: 07 Oct 2003
Posts: 510
Location: India

PostPosted: Aug 24th, 2004 08:10 AM    Post subject: Show / Hide Mouse Cursor Reply with quote

The ShowCursor API function provides a quick way to hide the
mouse cursor. It does not disables the mouse cursor just hides it.
To see what i mean, add the following code to a form.

[vb:1:051fa75358]Private Declare Function ShowCursor Lib "user32" (ByVal bShow As Long) As Long

Private Sub Form_Click()
ShowCursor True
End Sub

Private Sub Form_Load()
ShowCursor False
End Sub

Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
ShowCursor True
End Sub[/vb:1:051fa75358]
Now, run the project. When you click the form, Visual Basic toggles
off the cursor's visibility. Click the form once more, and the
mouse cursor reappears. If the mouse cursor had been truly
disabled, you wouldn't have been able to make the mouse cursor
reappear because the click wouldn't have registered.

Similar Threads:
MouseOver Effect on Command Buttons
Center the Mouse Pointer on a Control when it gets Focus
Limit Mouse Cursor Movement to Your Form
Simulate MouseEnter and MouseLeave Events
Detect Mouse Move System Wide
Check whether mouse is installed or not
Swap Mouse Buttons
_________________
Code Snippets, Tutorials, Utilities, Controls

Low cost Web Hosting
Hosting starts at as low as $4 per year!


Always follow posting guidelines
Put your VB code in [vb ] your code [ /vb] tags!
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger ICQ Number
Display posts from previous:   
Post new topic   Reply to topic    Visual Basic Forum for Visual Basic Programmers VB Forum Index » Knowledge Base All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Visual Basic Forum runs phpBB | Forum Template © iOptional
VB Resources | SSL | Visual Basic