![]() Gravitybox WebSchedule.NET
1998-2005 Gravitybox Software LLC
Page 60 of 65
Dim appointment As Appointment
'Add some appointments...
appointment.PropertyCollection.Add("", "MyProperty", "MyValue")
How do I ensure that an appointments length will be in a specified range?
When the user is resizing an appointment, he can set its length to any value. If you
need an appointment appointments length to be in a specified range this can be a
problem. Each appointment has a MinLength and MaxLength property that is used to
enforce its length. When either value is (-1) that value, either min or max, is not
enforced. The code snippet below ensures that the appointments length will always be
between 1 and 2 hours.
Dim appointment As Appointment
Add some an appointment
appointment.MinLength = 60
appointment.MaxLength = 120
How do I ensure that a specified area never receives appointments?
The NoDropAreaCollection allows you to add areas of the schedule where
appointments are invalid. These defined areas will be a specified color and appointment
moves or copies are not allowed. The code snippet below adds Jan 1, 2004 to the
NoDropAreaCollection. You may also define combinations of dates, times, room,
providers, etc.
Call Schedule1.NoDropAreas.Add(Color.Red, #1/1/2004#)
How do I customize an appointment, i.e. change the color or font?
An appointment has many properties to customize it appearance. The code snippet
below demonstrates some of them.
'Make the backcolor light blue
appointment.Appearance.BackColor = Color.LightBlue
'Make the text color black
appointment.Appearance.ForeColor = Color.Black
'Make the border this a system color
appointment.Appearance.BorderColor = SystemColors.ControlDark
'Make the font bold
appointment.Appearance.FontBold = True
Each appointment also has a header object. This object may be used to define a header
for the appointment and set it properties.
'Make the backcolor red
appointment.Header.Appearance.BackColor = Color.Red
'Draw the appointment's date in the header
|