DatePicker DayMetrics |
Post Reply |
Author | |
jcollier
Senior Member Joined: 15 February 2006 Status: Offline Points: 250 |
Post Options
Thanks(0)
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 |
|
sserge
Moderator Group Joined: 01 December 2004 Status: Offline Points: 1297 |
Post Options
Thanks(0)
|
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 |
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |