An Owner Drawn Calendar Control VB5/6
Posted
by Stefaan Casier
on January 30th, 2004
ENVIRONMENT This is a VB5 project, which will run under Windows 9x. No other than basic VB-controls are used. YOU CAN LEARN Something about making your own controls. ... COPYRIGHT None. I made the code myself and everybody is free to use it. RUNTIME FILES none CODE FILES Calendar.vbg stCalendarCtl.vbp/.vbw stCalendar.ctl/.ctx demo.vbp/.vbw frmDemoM.frm frmDemoSfrm calendar.bmp

Comments
Thanks ( and some code )
Posted by nacnudsco on 02/01/2006 04:51pmThanks dude. Most wonderful. I added the following code. '--------------------------------------------------------------------------------------- ' Procedure : GetSelectedDays ' DateTime : 01/02/2006 16:50 ' Author : nacnud ' Purpose : Just get a compressed list of the selected days '--------------------------------------------------------------------------------------- ' Public Function GetSelectedDays() As Long() Dim lngCounter As Long Dim selDays() As Long For lngCounter = 0 To M_LNG_MAXCONTROL If (CellTpe(OffsetCell + lngCounter) = Selected) Then '# If we have an uninitilised array If (Not selDays) = True Then ReDim Preserve selDays(0) Else '# Otherwise, dim on the current size of it. ReDim Preserve selDays(UBound(selDays) + 1) End If selDays(UBound(selDays)) = lngCounter End If Next lngCounter GetSelectedDays = selDays End FunctionReplySelect All and Deselect All for Calendar cells (code in comment)
Posted by CrimsonGhost on 11/03/2005 02:58pmMake the demo US compliant (code changes in this comment)
Posted by CrimsonGhost on 11/03/2005 01:59pmDblClick sample as requested (code in comment)
Posted by CrimsonGhost on 11/03/2005 01:38pm'Add these items to stCalendar.ctl to enable DblClick on the control: 'Under the variable declarations add: 'Stores MouseMove pointer coordinates Dim XX, YY as Integer 'Next add a subroutine for UserControl_MouseMove as follows: Private Sub UserControl_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single) XX = X YY = Y End Sub 'Finally, add a UserControl_DblClick subroutine. Private Sub UserControl_DblClick() Dim cl As Integer 'Determine what cell was clicked on cl = (YY \ szY) * 7 + XX \ szX 'The day number double-clicked is stored in the m_cDay variable by the MouseDown subroutine 'Determine cell type and react accordingly Select Case CellTpe(cl) Case Header: 'add code here for trapping click on day of the week header Case Normal: MsgBox m_cDay & " is unselected." 'display date number in a msgbox Case EmptyC: 'clicked on a blank cell Case Selected: MsgBox m_cDay & " is selected." End Select End SubReplystCalendarCtl - Very useful but missing one thing
Posted by ljwheeler on 07/14/2005 02:31pmNice control, is there a help file or read me?
Posted by travisreems on 05/24/2004 03:19amNice control, is there a help file or read me?
ReplyReally useful !
Posted by Legacy on 09/17/2003 12:00amOriginally posted by: Humberto
ReplyGREAT
Posted by Legacy on 05/15/2003 12:00amOriginally posted by: McJuke
fantastic code - thank you!!
ReplyAn Owner Drawn Calendar Control VB5/6 - Stefaan Casier
Posted by Legacy on 01/03/2003 12:00amOriginally posted by: Jose Pinto
Sr. Cassier
He visto algunos de sus trabajos, y debo confesarle que me
han gustado mucho, al punto que este Calendario junto con el del Reloj, los utilizo para mis proyectos de uso personal
en mi casa y con mis amigos. Y siento un gran orgullo al comentarles que son de un amigo alem�n.
Deseo felicitarlo sinceramente, sus trabajos son muy confiables y de buen sentido est�tico.
Deseo conocer m�s trabajos suyos, ya que estos aportan a mi pobre conocimiento de VB.
Gracias.
Jos�
ReplyGreat idea!
Posted by Legacy on 10/09/2002 12:00amOriginally posted by: Wrenashe
Good
Reply
Loading, Please Wait ...