Navigation bar
  Home Print document Start Previous page
 162 of 234 
Next page End  

Gravitybox Schedule Primer
Page 160 
1998-2004 Gravitybox Software LLC
date range displayed. For example, if we are in month mode and the selected date was
February 16, the displayed Month would be February. 
Schedule1.AutoRedraw = False
Select Case DisplayMode
  
  Case cdcDay:
    Call Schedule1.SetMinMaxDate( _
                  MonthView1.Value, MonthView1.Value)
  
  Case cdcWorkWeek:
    Call Schedule1.SetMinMaxDate( _
                  FirstDayOfWeek(MonthView1.Value, vbMonday), _
                  LastDayOfWeek(MonthView1.Value, vbFriday))
  
  Case cdcWeek:
  Call Schedule1.SetMinMaxDate( _
                  FirstDayOfWeek(MonthView1.Value), _
                  LastDayOfWeek(MonthView1.Value))
  Case cdcMonth:
    'Do Nothing Yet
End Select
Call LoadForm
Call RefreshHeaderFormat
Call frmMDI.SetStatus(oAppointments.Count & " Items")
Schedule1.AutoRedraw = True
This code will set the MinDate and MaxDate to the appropriate values depending on the
MonthView value and the display mode. Notice that the AutoRedraw was set to false
while loading occurred. This will speed up the loading significantly. The schedule will
normally redraw itself after every appointment addition. We will toggle this feature off
only during load.
Figure 16.6
http://www.purepage.com