472,122 Members | 1,567 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,122 software developers and data experts.

How to capture Mouse Single click and mouse double click event

Hi All,

How to capture Mouse Single click and mouse double click event on Commnad
Button.
I am doing as follows.

Private void Button1_MouseUp(Object sender,
System.Windows.Forms.MouseEventArgs e)

{

If (e.Clicks = 1)

{MsgBox("1");}

Else

{MsgBox("2");}

}

But each time I gets single click.
Even after clicking mouse button twice, events gets fired on first click and
I am not been able to capture double click event.

Any suggestions will be appreciated.

Thanks in advance
Sakharam Phapale


Nov 16 '05 #1
1 14274
Hi Sakharam

You need to implement the DoubleClick event, which is part of this page in
the msdn online.
http://msdn.microsoft.com/library/en...sFormsArchitec
ture.asp

Hope this helps

Publicjoe

C# Tutorial at http://www.publicjoe.f9.co.uk/csharp/tut.html
C# Snippets at http://www.publicjoe.f9.co.uk/csharp/snip/snippets.html
C# Ebook at http://www.publicjoe.f9.co.uk/csharp/samples/ebook.html
VB Tutorial at http://www.publicjoe.f9.co.uk/vbnet/vbnet.html
VB Ebook at http://www.publicjoe.f9.co.uk/vbnet/samples/ebook.html

Useful Articles at http://www.madsally.co.uk
"Sakharam Phapale" <sp******@annetsite.com> wrote in message
news:OE**************@TK2MSFTNGP10.phx.gbl...
Hi All,

How to capture Mouse Single click and mouse double click event on Commnad
Button.
I am doing as follows.

Private void Button1_MouseUp(Object sender,
System.Windows.Forms.MouseEventArgs e)

{

If (e.Clicks = 1)

{MsgBox("1");}

Else

{MsgBox("2");}

}

But each time I gets single click.
Even after clicking mouse button twice, events gets fired on first click and I am not been able to capture double click event.

Any suggestions will be appreciated.

Thanks in advance
Sakharam Phapale


Nov 16 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by scott_gui | last post: by
2 posts views Thread by scott_gui | last post: by
4 posts views Thread by Venkatesh | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.