Solved

Windows.Forms.Cursor.Hide()

Posted on 2009-04-14
2
514 Views
Last Modified: 2012-08-13
in Form2_Load i use Windows.Forms.Cursor.Hide()

then ..

on Form2_Load

Windows.Forms.Cursor.Show()

so far so good .. now i want the cursor hidden again when a close button on form2 is pressed or a user hits close button in the FormBorder..

On Event: Form2_Closing : Windows.Forms.Cursor.Hide()

This Event should be trigger both when the close button is hit on the FormBorder as wel on the when Button1 on Form2 is clicked ..

For some reason this is not working




Private Setup_Closing(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles MyBase.Closing

       

      Windows.Forms.Cursor.Hide()
 

    End Sub
 
 

    Private Sub Setup_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
 

        Windows.Forms.Cursor.Show()
 

    End Sub
 

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
 

        Me.Close()
 

    End Sub

Open in new window

0
Comment
Question by:Amien90
2 Comments
 
LVL 17

Accepted Solution

by:
xDJR1875 earned 500 total points
ID: 24143183
Perhaps you need to set a global cursor state flag and then when the first form gets the focus back, check the cursor status flag and set it appropriately.
0
 

Author Comment

by:Amien90
ID: 24151302
Windows.Forms.Cursor.Hide() is the global cursus state flag i think. Whats the event is fired right afte form1 gets back in focus?
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

A while ago, I was working on a Windows Forms application and I needed a special label control with reflection (glass) effect to show some titles in a stylish way. I've always enjoyed working with graphics, but it's never too clever to re-invent …
1.0 - Introduction Converting Visual Basic 6.0 (VB6) to Visual Basic 2008+ (VB.NET). If ever there was a subject full of murkiness and bad decisions, it is this one!   The first problem seems to be that people considering this task of converting…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now