Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Calendar
  New Posts New Posts RSS Feed - DatePicker DayMetrics
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

DatePicker DayMetrics

 Post Reply Post Reply
Author
Message
jcollier View Drop Down
Senior Member
Senior Member


Joined: 15 February 2006
Status: Offline
Points: 250
Post Options Post Options   Thanks (0) Thanks(0)   Quote jcollier Quote  Post ReplyReply Direct Link To This Post Topic: DatePicker DayMetrics
    Posted: 30 August 2006 at 1:56pm
In the VB6 DatePicker Sample, how would I go about using the DayMetrics with the wndLabel_PopUp control?

I have a similar function in my app and I would like to change the weekend days to Red but I don't know how to get to the DayMetrics with this function.

Below is the code in the MouseDown event for the text box:


Dim pDatePicker
    Set pDatePicker = CreateObject("Codejock.DatePicker." + XtremeCalendarControl.Version)
   
    If Not pDatePicker Is Nothing Then
   
        Dim pixX As Long, pixY As Long, pixWidth As Long, pixHeight As Long
       
        pixX = x / Screen.TwipsPerPixelX
        pixY = y / Screen.TwipsPerPixelY
               
        pDatePicker.GetMinReqRect pixWidth, pixHeight, 2, 2

       
        If pDatePicker.ShowModalEx(pixX, pixY, pixWidth, pixHeight, wndLabel_PopUp.hwnd) Then
       
            Dim strDate0 As String, strDate1 As String
            Dim nCount As Long
           
            nCount = pDatePicker.Selection.BlocksCount
            If nCount > 0 Then
                cmbPopUp.Refresh
                cmbPopUp.Text = pDatePicker.Selection.Blocks(0).DateBegin
                                       
                strDate0 = pDatePicker.Selection.Blocks(0).DateBegin
                strDate1 = pDatePicker.Selection.Blocks(nCount - 1).DateEnd
               
                wndLabel_PopUp.Text = strDate0 & " - " & strDate1
            End If
       
        End If
    End If
Back to Top
sserge View Drop Down
Moderator Group
Moderator Group


Joined: 01 December 2004
Status: Offline
Points: 1297
Post Options Post Options   Thanks (0) Thanks(0)   Quote sserge Quote  Post ReplyReply Direct Link To This Post Posted: 30 August 2006 at 3:50pm
You'll have to catch DayMetrics event, and this could be done only when you declare your DatePicker control globally. This could be whether simple adding control to the form not visible, and then making it visible when needed; or try declaring it as "Dim WithEvents pDatePicker As DatePicker" and catch DayMetrics.

--
WBR,
Serge
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.203 seconds.