Solved

Windows.Forms.Cursor.Hide()

Posted on 2009-04-14
2
516 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Getfiles in vb.net 28 42
Put window Form inside tab page 10 26
Receiving a string from a WebService Push 21 31
Need a starter for ETL protocol? 4 33
Well, all of us have seen the multiple EXCEL.EXE's in task manager that won't die even if you call the .close, .dispose methods. Try this method to kill any excels in memory. You can copy the kill function to create a check function and replace the …
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

932 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

11 Experts available now in Live!

Get 1:1 Help Now