Solved

Windows.Forms.Cursor.Hide()

Posted on 2009-04-14
2
530 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 17

Accepted Solution

by:
Daniel Reynolds 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

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

Question has a verified solution.

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

If you're writing a .NET application to connect to an Access .mdb database and use pre-existing queries that require parameters, you've come to the right place! Let's say the pre-existing query(qryCust) in Access takes a Date as a parameter and l…
Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…

717 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