For Programmers: Free Programming Magazines  


Home > Archive > C# > February 2005 > MouseLeave MouseDrag C# Problem









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author MouseLeave MouseDrag C# Problem
Jim

2005-02-23, 3:59 am

I've written some code on 2 pictureboxes that behave like custom buttons.
MouseDown Event makes the up-picture-button not visible and the
down-picture-button visible, MouseUp Event makes the up-button-pictiure
visible and the down-picture-button not visible. It gives the illisuion of
the button being depressed. So far so good.

I also have other code in the MouseUp that activates an mp3 player.

The problem is this. If a usr depresses the button in the MouseDown Event,
but decides he doesn't want to press that button after all, he then drags
the mouse-cursor off the button. Once off the button I want the code in the
MouseUp canceled and I want the up-button-picture to show.

I tried doing this with the MouseLeave event but if the user has a button
depressed it won't work. I also tried the MouseDrag but that's not working
either.

Any suggestions???


Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com