473,405 Members | 2,294 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

MouseEventArgs and a Clicks property

Hi,

I'm working on control that uses a MonthCalendar.
A MonthCalendar have not a DoubleClick event, so
i tried to use the events related with MouseEventArgs
parameter. I was trying to check "Clicks" property, but
it returns always 1.
Is there any chance to get "Clicks" greater than one?

Thanks in advance.
--
Marcin Grzębski
mg*******@taxussi.no.com.spam.pl
Feb 15 '06 #1
3 4899
Hi
Here is a solution from post:
http://groups.google.com/group/micro...1f442f376022d9

Try this: (assumes a monthcalendar control called MonthCalendar1 and a
textbox control called TextBox1)

Private m_NumClicks As Short = 0
Private m_FirstClick As Long

Private Sub MonthCalendar1_DateSelected( _
ByVal sender As Object, _
ByVal e As System.Windows.Forms.DateRangeEventArgs) _
Handles MonthCalendar1.DateSelected

If m_NumClicks >= 2 Then
TextBox1.Text = e.Start.Date.ToString
m_NumClicks = 0
End If

End Sub

Private Sub MonthCalendar1_MouseDown( _
ByVal sender As Object, _
ByVal e As System.Windows.Forms.MouseEventArgs) _
Handles MonthCalendar1.MouseDown

If e.Button = MouseButtons.Left Then
If m_NumClicks = 0 Then
m_FirstClick = Now.Ticks
m_NumClicks += 1
ElseIf (Now.Ticks - m_FirstClick) > 2000000 Then
m_NumClicks = 0
Else
m_NumClicks += 1
End If
End If
End Sub
Jacob Grass
Microsoft .NET MVP

Feb 15 '06 #2
Hi,

Thank You very much!

Marcin

AH****@gmail.com wrote:
Hi
Here is a solution from post:
http://groups.google.com/group/micro...1f442f376022d9

Try this: (assumes a monthcalendar control called MonthCalendar1 and a
textbox control called TextBox1)

Private m_NumClicks As Short = 0
Private m_FirstClick As Long

Private Sub MonthCalendar1_DateSelected( _
ByVal sender As Object, _
ByVal e As System.Windows.Forms.DateRangeEventArgs) _
Handles MonthCalendar1.DateSelected

If m_NumClicks >= 2 Then
TextBox1.Text = e.Start.Date.ToString
m_NumClicks = 0
End If

End Sub

Private Sub MonthCalendar1_MouseDown( _
ByVal sender As Object, _
ByVal e As System.Windows.Forms.MouseEventArgs) _
Handles MonthCalendar1.MouseDown

If e.Button = MouseButtons.Left Then
If m_NumClicks = 0 Then
m_FirstClick = Now.Ticks
m_NumClicks += 1
ElseIf (Now.Ticks - m_FirstClick) > 2000000 Then
m_NumClicks = 0
Else
m_NumClicks += 1
End If
End If
End Sub
Jacob Grass
Microsoft .NET MVP

--
Marcin Grzębski
mg*******@taxussi.no.com.spam.pl
Feb 15 '06 #3
Your Welcome

Feb 15 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: JH | last post by:
Where can I find an event handler for the wheel mouse scroll event? Is there one in the MouseEventArgs somewhere? Thanks in advance for your assistance.
1
by: Rob Schoenaker | last post by:
Hi, Does anybody know how I can convert all mouse messages in the following list to their respective MouseEventArgs to pass to events handlers I need these to use a NativeWindow? WM_MouseMove...
7
by: Ramsi | last post by:
My development environment is ASP.Net 1.1. Clicked event of a button has lengthy procedure it will take 2 to 4 seconds to process the data. My question is, 1.. If the user clicks the button...
1
by: Per Larsson | last post by:
Hi all! I am working with a project and want to make a form that is semi transparent, and transparent to mouse clicks. (Se through and click through.) The form shall be visible but opaque and the...
5
by: Sam | last post by:
Hi, Protected Overrides Sub OnControlAdded(ByVal e As System.Windows.Forms.ControlEventArgs) AddHandler e.Control.MouseMove, DirectCast(CheckCursor(), System.Windows.Forms.MouseEventHandler)...
1
by: Badass Scotsman | last post by:
Hello, I have an application which should never allow the back button to be pushed without refreshing the previous page. For example: Step 1: User fills in form.html and presses submit ...
2
by: polocar | last post by:
Hi, suppose that you have a C# form with two buttons, that are the classical "btnOk" and "btnCancel" (besides them, of course in the form there can be many other controls). When the user clicks...
4
by: Peted | last post by:
Hello this is the click event method of a radio button private void radioButton1_Click(object sender, EventArgs e) { }
2
by: ducttape | last post by:
Hello I'm busy working with an MDI parent and child forms. I've found that there is a discrepancy between the locations returned by DesktopLocation, Control.MousePosition and MouseEventArgs...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.