Last few days, I have been trying to use a Button as a drag and drop object in Silverlight 4, but the MouseLeftButtonUp and MouseLeftButtonDown event just won’t fire up no matter how I click on it. After some search, I found out that MouseLeftButtonUp and MouseLeftButtonDown event in Button is handle by Click event thus it won’t trigger MouseLeftButtonUp and MouseLeftButtonDown anymore.
One solution for this is to create an inherited Button class and override MouseLeftButtonUp and MouseLeftButtonDown event by setting Handled to false so that it won’t handle by Click event. While the other solution is to use other UIElement control instead of Button.
But I’m lazy to create a class just for this purpose and I need a Button control. After some search on MSDN, I found out that I can prevent Click event to handle MouseLeftButtonUp and MouseLeftButtonDown event by setting button’s ClickMode to Hover which was by default is Press. It’s work! With just a single line or a property set, I can enable back MouseLeftButtonUp and MouseLeftButtonDown event for button now.
by Ooi Keng Siang via Ooiks’s Blog
Hey ,
i am a user of your mousehunt autobot programme.
Just wondering what do you mean by pause before kings reward?
Secondly, is there an alarm when kings reward pops out to inform users?
Thirdly, as the moushunt programme was changed, trap check time for each individual has changed. For exmaple, my trap check is at 1:30.2:30 ….6:30,7:30 and every 30 mins instead of the start of a new hour, 1:00,2:00….ect
Please reply ASAP or drop me an email.
regards,
jason
LikeLike
Hey ,
i am a user of your mousehunt autobot programme.
Just wondering what do you mean by pause before kings reward?
Secondly, is there an alarm when kings reward pops out to inform users?
Thirdly, as the moushunt programme was changed, trap check time for each individual has changed. For exmaple, my trap check is at 1:30.2:30 ….6:30,7:30 and every 30 mins instead of the start of a new hour, 1:00,2:00….ect
Please reply ASAP or drop me an email.
Thank you
regards,
jason
LikeLike
Did you know is there a property like ClickMode for other controls like ComboBox?
LikeLike
I don’t think so, what are you doing with that?
LikeLike
i want to drag and drop my controls in a window.
based on this article:
http://www.wintellect.com/CS/blogs/jprosise/archive/2009/11/26/silverlight-4-s-new-drag-and-drop-support.aspx
LikeLike