![]() Gravitybox Schedule.NET
1998-2005 Gravitybox Software LLC
Page 80 of 90
appointment covers. For example, an appointment from 1:00AM on Jan 1 to 11:00PM
Jan 2 covers 46 hours but it only crosses 1 day boundary.
Dim days As Integer = appointment.DaySpan
How do I display a colored bar next to an appointment?
There are four ways to configure an appointments left side bar: none, category,
provider, or user-drawn. The first, none, displays no bar at all. The second, category,
displays a colored bar the same color as the first category object in the appointments
CategoryList object. If no categories are present in this list, no bar is drawn. The third,
provider, displays a colored bar the same color as the first provider object in the
appointments ProviderList object. If no providers are present in this list, no bar is
drawn. The last, user-drawn, is quite interesting. It allows you receive notification
through the UserDrawnBar event when an appointment bar needs to be drawn and
allows you to draw your own custom bar.
Schedule1.AppointmentBar = _
Gravitybox.Controls.Schedule.AppointmentBarConstants.None
Schedule1.AppointmentBar = _
Gravitybox.Controls.Schedule.AppointmentBarConstants.Category
Schedule1.AppointmentBar = _
Gravitybox.Controls.Schedule.AppointmentBarConstants.Provider
Schedule1.AppointmentBar = _
Gravitybox.Controls.Schedule.AppointmentBarConstants.UserDrawn
How do I draw a custom bar next to an appointment?
When the AppointmentBar property is set the UserDrawn, the UserDrawnBar event is
raised when the bar needs to be drawn. You, the developer, are responsible for drawing
the bar at the proper location. The event exposes the graphics object used to draw the
bar. It also exposes the valid rectangle in which to draw. The rectangle defines the
appointment bar rectangle. Do not draw outside the rectangle as your changes may or
may not be overdrawn.
How do I speed-up appointment loading?
If many appointments are loaded at one time you may experience a slowness or drag.
This is because the screen may be repainting many times upon loading. To ensure the
fastest loading use the AutoRedraw property. Toggle it to false to turn off screen
painting and then load the schedule. Be sure to toggle it back to true or the screen will
never repaint.
Schedule1.AutoRedraw = False
'Add Appointments...
Schedule1.AutoRedraw = True
|