Jump to content
  • Advertisement
Sign in to follow this  
Cybrosys

[.net] DoubleClick, which button

This topic is 4895 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I've got my trayicon and when i dbl click it the application pops up as it should. The problem is that the application pops up when i double click the right mouse button. The EventArgs sent to the DoubleClick event is a plain EventArgs and doesn't contain information as to what button was double clicked. This is a problem seeing as i don't want the form to become visible if i double rightclick. I've thought about handling the MouseUp message for the tray icon, making sure that the mouseeventargs.clicks doesn't go over 1 if it's not the left mouse button that was clicked. But the e.Clicks accessor doesn't allow me to alter the clicks value, not that it'd realy matter since the MouseUp event doesn't fire the dbl click event =/ Edit: Nvm, i figured it out. I'll ignore handling the DblClick event and just handle the MouseUp event and check if the clicks >= 2 and mb == left. Edit: For some reason that didn't work, i can't seem to get clicks over 0 =/

Share this post


Link to post
Share on other sites
Advertisement
According to this, a click event is always raised when a control is double clicked. Don't know if this'll help you, but I thought you might be interested in it.

Share this post


Link to post
Share on other sites
I'm using .net 1.1 and neither the double click or the click event gets any kind of information as to what mouse button was pressed from the notifyIcon.

Handling the MouseDown event, checking to se if the left mouse button was pressed recently and setting the bool to true, so that i can check against it in the DoubleClick event doens't realy go with my taste but it works.

Have i stumbled across a faulty form design? I haven't tested 2.0 yet but do they send a MouseEventArgs to the Click and DoubleClick events there or is it still just a EventArgs ?

[Edited by - Cybrosys on July 20, 2005 8:34:49 AM]

Share this post


Link to post
Share on other sites
Well, I'm not using .net at all, was just trying to help [smile]. But if it works, and if you're not doing it everywhere in your code, you should just leave it at that. "Försök inte laga det som inte är trasigt", as they use to say. There's propably some way to do it better, there always is, but I don't know how.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!