473,624 Members | 2,264 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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*******@taxus si.no.com.spam. pl
Feb 15 '06 #1
3 4906
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.DateRange EventArgs) _
Handles MonthCalendar1. DateSelected

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

End Sub

Private Sub MonthCalendar1_ MouseDown( _
ByVal sender As Object, _
ByVal e As System.Windows. Forms.MouseEven tArgs) _
Handles MonthCalendar1. MouseDown

If e.Button = MouseButtons.Le ft 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.co m 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.DateRange EventArgs) _
Handles MonthCalendar1. DateSelected

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

End Sub

Private Sub MonthCalendar1_ MouseDown( _
ByVal sender As Object, _
ByVal e As System.Windows. Forms.MouseEven tArgs) _
Handles MonthCalendar1. MouseDown

If e.Button = MouseButtons.Le ft 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*******@taxus si.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
1802
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
2371
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 WM_LButtonDown WM_MButtonDown WM_RButtonDown
7
1772
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 again, will the clicked event called again? 2.. If yes to the above question how to avoid these kinds of scenarios? Thanks for your suggestions. Ramsi
1
2909
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 mouse clicks shall go through to the under lying window. I can make it transparent by setting the Opaqe property, and by setting the TransparencyKey colour I can make it click through in parts that then becomes invisible. But I want the hole...
5
4079
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) End Sub The above code is to redirect the MouseMove event of any controls added to my panel to the method CheckCursor. This works except that
1
6718
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 Step 2: User see's results.html and clicks back to amend form
2
3294
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 on btnOk, the program makes some confirm operations and closes the form. When the user clicks on btnCancel, the program makes some cancel operations and closes the form. My problem is that, when the user clicks on the "X" button of the form...
4
9592
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
5448
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 e.Location, but I can't work out why or what exactly the discrepancy is. My forms are all custom without title bars and thus I've had to create my own moving methods, etc. This is obviously related to the location of the mouse pointer. My mouse...
0
8233
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8170
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8675
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8334
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8474
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7158
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
2604
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1784
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1482
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.