Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Hi,

I control librairy project with visual studio.net and I'm having trouble changing the mouse cursor in my UserControl. The cursor changes fine but the application hangs(1/2 of the times) when I try to close it.

 

this is a control librairy project so a UserControl derived class that I've added two event handlers for mouseDown and MouseUp, the rest is auto-generated 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;

}

 

So if anyone knows why this crashes when the application is closed, I would be very greatfull.

thanks in advance

dominic

Posted

You didn't provide enouph info, everything you posted looks good. I don't think changing the mouse cursor as you did is the problem.

 

What error message are you getting?

Can you post all the code, or another problem area?

C#
Posted

Thanks for replying, I'm having a hard time with this problem.

 

The code that I provided is the only code I added. The rest is code generated by VS.Net for a Control librairy project.

 

I put the file as an attachment if you find something

dom

usercontrol1.cs

Posted

I don't get any error messages, I execute in debug mode and when I close the form (the form that has an instance of the control on it) visual stdio stays in debug mode. The output window never displays the message:The program '[3492] testReproduceProblem.exe' has exited with code 0 (0x0)

 

However in Release mode everything is fine

 

????

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...