469,342 Members | 5,699 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,342 developers. It's quick & easy.

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 13606
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
reply views Thread by suresh191 | last post: by
1 post views Thread by haryvincent176 | last post: by
1 post views Thread by Marylou17 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.