DatePicker DayMetrics
Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Calendar
Forum Description: Topics Related to Codejock Calendar
URL: http://forum.codejock.com/forum_posts.asp?TID=4925
Printed Date: 22 November 2024 at 4:52pm Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com
Topic: DatePicker DayMetrics
Posted By: jcollier
Subject: DatePicker DayMetrics
Date 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
|
Replies:
Posted By: sserge
Date 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
|
|