Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

changing the default mouse cursor problem

Status
Not open for further replies.

dompaq

Programmer
Dec 2, 2002
2
CA
Hi,
I encountered a problem and I don't know if it's a bug or
if I'm doing something wrong. I wrote a UserControl in
which I wireup 2 event handlers MouseDown and MouseUp.
MouseDown changes the cursor to a hand and MouseUp
restores the default cursor, here's the code:

private void ReproduceProblem_MouseDown(object sender,
System.Windows.Forms.MouseEventArgs e)
{
this.Cursor = Cursors.Hand;
}

private void ReproduceProblem_MouseUp(object sender,
System.Windows.Forms.MouseEventArgs e)
{
this.Cursor = Cursors.Default;
}


These are the only lines that I have added in the
UserControl project. Here is my problem when I add the control to
a form and run it, the cursor responds correctly(it chages to a hand
and back to the arrow) but when I close the form the
application hangs 1 out of 2 times.

If anyone knows what I'm doing wrong please help!
Thanks in advance
dominic
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top