TechnoTone Posted July 9, 2003 Posted July 9, 2003 How do you set the mouse cursor to nothing. I want the ability to hide and show the cursor on my form. I can think of a work around whereby I move the cursor to the bottom left corner of the screen but this isn't ideal. Quote TT (*_*) There are 10 types of people in this world; those that understand binary and those that don't.
TechnoTone Posted July 9, 2003 Author Posted July 9, 2003 You can use Cursor.Hide() and Cursor.Show() OMG! :eek: I can't believe I missed that! How stupid do I feel??? :confused: Thanks. Quote TT (*_*) There are 10 types of people in this world; those that understand binary and those that don't.
TechnoTone Posted July 10, 2003 Author Posted July 10, 2003 I'm still having trouble with this. I have a form with a timer that detects when the mouse moves and then displays a couple of buttons and the mouse cursor. After 3 seconds it is then supposed to hide the buttons and the mouse cursor. Unfortunately, it does't hide the mouse cursor. The form code is attached. :confused: :confused: :confused:frmdisplay.vb Quote TT (*_*) There are 10 types of people in this world; those that understand binary and those that don't.
Leaders dynamic_sysop Posted July 10, 2003 Leaders Posted July 10, 2003 try something like this : Dim x As Integer = 0 '/// somewhere near top of your form ( under windows generated code ) '////////// Private Sub Form1_MouseEnter(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.MouseEnter Timer1.Start() Button2.Visible = True Button3.Visible = True End Sub Private Sub Timer1_Tick(ByVal sender As Object, ByVal e As System.EventArgs) Handles Timer1.Tick x += 1 If x = 3 Then Timer1.Stop() Button2.Visible = False Button3.Visible = False x = 0 '/// reset the counter End If End Sub Quote
TechnoTone Posted July 11, 2003 Author Posted July 11, 2003 Thanks, but that doesn't actually address my problem. Quote TT (*_*) There are 10 types of people in this world; those that understand binary and those that don't.
JABE Posted July 11, 2003 Posted July 11, 2003 One thing about Cursor.Show()/Hide() is that it doesn't seem to work if not invoked on the main thread. In my first reply to your post, I tested it first on a separate thread but it didn't work. Maybe that behavior is related to what you're experiencing now since you're trying to invoke Cursor.Show()/Hide() from the Tick event of a timer. Quote
TechnoTone Posted July 11, 2003 Author Posted July 11, 2003 Strange! Quote TT (*_*) There are 10 types of people in this world; those that understand binary and those that don't.
JumpyNET Posted January 4, 2006 Posted January 4, 2006 Another way... With this I get error messages about intances and such: You can use Cursor.Hide() and Cursor.Show() But this API worked nicely: Private Declare Function ShowCursor Lib "user32" (ByVal bShow As Boolean) As Long And simply call it like this: ShowCursor(False) ShowCursor(True) Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.