Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Controls
  New Posts New Posts RSS Feed - Month Calendar Double Click
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Month Calendar Double Click

 Post Reply Post Reply
Author
Message
tomurphy View Drop Down
Groupie
Groupie
Avatar

Joined: 06 June 2008
Location: Australia
Status: Offline
Points: 21
Post Options Post Options   Thanks (0) Thanks(0)   Quote tomurphy Quote  Post ReplyReply Direct Link To This Post Topic: Month Calendar Double Click
    Posted: 17 November 2008 at 6:54pm
Hi
 
I am using version 12.0.0 and am finding a mouse double click anywhere in the month calendar control calls OnDblClick.  Shouldn't this only be called when double clicking on an actual day??
 
Cheers
Tom
 
CodeJock Com Suite 12.0.0
Visual Dataflex 14.0
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 18 November 2008 at 3:53am
Hi,
It works like Calendar Control from Microsoft common controls.
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
tomurphy View Drop Down
Groupie
Groupie
Avatar

Joined: 06 June 2008
Location: Australia
Status: Offline
Points: 21
Post Options Post Options   Thanks (0) Thanks(0)   Quote tomurphy Quote  Post ReplyReply Direct Link To This Post Posted: 18 November 2008 at 5:55am
Thanks for the reply Oleg, I take it that means there's nothing you or I do can do?
 
Cheers
Tom
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 18 November 2008 at 6:26am
yes :(
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
jpbro View Drop Down
Senior Member
Senior Member
Avatar

Joined: 12 January 2007
Status: Offline
Points: 1354
Post Options Post Options   Thanks (0) Thanks(0)   Quote jpbro Quote  Post ReplyReply Direct Link To This Post Posted: 18 November 2008 at 1:46pm
I looked around the web to see if I could find any information on MonthView messages, and luckily I discovered one called MCM_HITTEST that looked promising. After a bit of digging & experimentation, I came up with this code that should do what you require (only count the double-click when on a date, or on the Today link):


Option Explicit

Private Type POINTAPI
   x As Long
   y As Long
End Type

Private Type SYSTEMTIME
   wYear As Integer
   wMonth As Integer
   wDayOfWeek As Integer
   wDay As Integer
   wHour As Integer
   wMinute As Integer
   wSecond As Integer
   wMilliseconds As Integer
End Type

Private Type MCHITTESTINFO
   Size As Long
   Point As POINTAPI
   HitItem As Long
   HitDate As SYSTEMTIME
End Type

Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Private Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long
Private Declare Function ScreenToClient Lib "user32" (ByVal hwnd As Long, lpPoint As POINTAPI) As Long

Private Const MCM_FIRST As Long = &H1000
Private Const MCM_HITTEST As Long = (MCM_FIRST + 14)

Private Const MCHT_CalendarDate As Long = &H20001
Private Const MCHT_CalendarToday As Long = &H30000

Private Sub MonthCalendar1_DblClick()
   Dim l_Pt As POINTAPI
   Dim l_Hit As MCHITTESTINFO
  
   GetCursorPos l_Pt
   ScreenToClient Me.MonthCalendar1.hwnd, l_Pt
  
   With l_Hit
      .Size = LenB(l_Hit)
      .Point.x = l_Pt.x
      .Point.y = l_Pt.y
   End With
   SendMessage Me.MonthCalendar1.hwnd, MCM_HITTEST, 0, l_Hit
  
   Select Case l_Hit.HitItem
   Case MCHT_CalendarDate
      MsgBox "Double-clicked a date on the calendar: " & Format$(Me.MonthCalendar1.Value, "Long Date")
   Case MCHT_CalendarToday
      MsgBox "Double-clicked the ""Today"" link", vbOKOnly
   End Select
End Sub

Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3

Language: Visual Basic 6.0 SP6

Back to Top
tomurphy View Drop Down
Groupie
Groupie
Avatar

Joined: 06 June 2008
Location: Australia
Status: Offline
Points: 21
Post Options Post Options   Thanks (0) Thanks(0)   Quote tomurphy Quote  Post ReplyReply Direct Link To This Post Posted: 18 November 2008 at 6:23pm
Thanks for that mate I'll give it a go!
 
Cheers,
Tom
Back to Top
ijwelch View Drop Down
Senior Member
Senior Member


Joined: 20 June 2006
Status: Offline
Points: 262
Post Options Post Options   Thanks (0) Thanks(0)   Quote ijwelch Quote  Post ReplyReply Direct Link To This Post Posted: 18 November 2008 at 8:09pm
Maybe CJ can add HitTest method.
Back to Top
tomurphy View Drop Down
Groupie
Groupie
Avatar

Joined: 06 June 2008
Location: Australia
Status: Offline
Points: 21
Post Options Post Options   Thanks (0) Thanks(0)   Quote tomurphy Quote  Post ReplyReply Direct Link To This Post Posted: 18 November 2008 at 9:24pm
For the 12.1 release?
Back to Top
jpbro View Drop Down
Senior Member
Senior Member
Avatar

Joined: 12 January 2007
Status: Offline
Points: 1354
Post Options Post Options   Thanks (0) Thanks(0)   Quote jpbro Quote  Post ReplyReply Direct Link To This Post Posted: 18 November 2008 at 9:29pm
Glad to help tom...

Here's where I found the MonthView constants in case anyone is interested:

http://notmyspace.info/run/Include/DateTimeConstants.au3
Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3

Language: Visual Basic 6.0 SP6

Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.156 seconds.