 |
| View previous topic :: View next topic |
| Author |
Message |
Avis Junior Poster

Joined: 07 Oct 2003 Posts: 510 Location: India
|
Posted: Aug 24th, 2004 08:10 AM Post subject: Show / Hide Mouse Cursor |
|
|
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 |
|
|
|
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
|
|