Schedule.NET
ActiveX
General
Site



DOWNLOADS | eSTORE | CONTACT | MESSAGE BOARD

Schedule.NET How Do I?



1. How do I add an appointment (room, category, etc.) in code?
Adding an appointment or any other object in code is easy. All you need to do is call the “Add” method on the collection to which you wish to add an object. Code to add an appointment to the Appointments collection is below. The added appointment will be scheduled for Jan1, 2004 at 10:00AM for a duration of 1 hour.

Schedule1.AppointmentCollection.Add("", #1/1/2004#, #10:00:00 AM#, 60)

To add a category, provider, or room is may be performed with one line of code as well as follows.

Call Schedule1.CategoryCollection.Add("", "MyCategory") Call Schedule1.ProviderCollection.Add("", "MyProvider") Call Schedule1.RoomCollection.Add("", "MyRoom")

Each Add method’s first parameter is a key (string). If this parameter is not specified (empty string) then one is assigned to the object when it is created.

2. How do I associate a room with an appointment?
Each appointment may be assigned to exactly 0 or 1 room. If no room is associated then the appointment will not be displayed when the schedule is in a viewmode that shows room information. However if a room is associated with an appointment, it will be shown in its proper room in these viewmodes. The following example adds 1 room and then adds 1 appointment. It sets the appointment’s room property to the newly created room object.

Dim room As Room = Schedule1.RoomCollection.Add("", "MyRoom") Dim appointment As Appointment = _ Schedule1.AppointmentCollection.Add("", #1/1/2004#, _ #10:00:00 AM#, 60) appointment.Room = room


3. How do I add categories and providers to an appointment?
Unlike rooms where only 1 object may be associated with an appointment, any number of categories or providers may be associated with an appointment. The following example adds 10 categories and provider to the schedule’s CategoryCollection and ProviderCollection. These collections must be populated because appointments cannot create new category or provider objects. Each appointment can only point at existing objects. The example adds 3 categories to the appointment’s CategoryList object and 3 providers to the appointment’s ProviderList object.
Dim ii As Integer For ii = 1 To 10 Call Schedule1.CategoryCollection.Add("", "Category" & ii.ToString()) Call Schedule1.ProviderCollection.Add("", "Provider" & ii.ToString()) Next Dim appointment As Appointment = _ Schedule1.AppointmentCollection.Add("", _ #1/1/2004#, #10:00:00 AM#, 60) Call appointment.CategoryList.Add(Schedule1.CategoryCollection(2)) Call appointment.CategoryList.Add(Schedule1.CategoryCollection(5)) Call appointment.CategoryList.Add(Schedule1.CategoryCollection(7)) Call appointment.ProviderList.Add(Schedule1.ProviderCollection(1)) Call appointment.ProviderList.Add(Schedule1.ProviderCollection(6)) Call appointment.ProviderList.Add(Schedule1.ProviderCollection(9))

4. How do I import/export an appointment to/from a VCAL file?
The VCAL file format is an international standard that is used to exchange calendar information. The GbSchedule.NET component supports importing and exporting this file format. The code snippet below exports the entire AppointmentCollection to this file format. The method “ToVCAL” is overloaded and may save any number of appointments to this file format. When importing a file, all appointments in the file are added to the AppointmentCollection object.
Call Schedule1.AppointmentCollection.ToVCAL("c:\test.vcal") Call Schedule1.AppointmentCollection.FromVCAL("c:\test.vcal")

5. How do I get an appointment from coordinates?
The method “GetAppointmentFromCor” on the ScheduleVisibilty object will return an appointment under a pair of coordinates, if one exists. The code snippet below demonstrates this.
Dim appointment As Appointment = _ Schedule1.Visibility.GetAppointmentFromCor(150, 200)

6. How do I save/load an appointment to/from an XML stream?
One or more appointments may be saved to an XML stream. This is done using the “ToXML” function of an appointment object.
Dim s As String = Schedule1.AppointmentCollection.ToXML()

Also the AppointmentCollection object allows you save the entire collection is an XML file using the “SaveXML” method.
Call Schedule1.AppointmentCollection.SaveXML("c:\test.xml")

A single appointment may be saved to an XML stream using its “ToXML” method.

Dim s As String = appointment.ToXML()

7. How do I get the index of an object in its parent collection?
There are times when you may need to know an object’s index in its parent collection. This information may be obtained from the parent collection itself. This paradigm holds true for all object collections. A return value of (-1) indicates that the object does not exist in the collection.
Dim index As Integer = _ Schedule1.AppointmentCollection.IndexOf(appointment)

8. How do I query the appointment collection?
The AppointmentCollection has a method “Find” that may be used to return an AppointmentList. The code snippet below demonstrates two ways to call the method. The first returns all appointments for Jan 1, 2004. The second example shows how to find all appointments with a subject set to the value “MySubject”.
Dim al As AppointmentList al = Schedule1.AppointmentCollection.Find(#1/1/2004#, #1/1/2004#) al = Schedule1.AppointmentCollection.Find("MySubject")

9. How do I combine multiple lists to get a single list?
The AppointmentCollection’s method “Find” can be used to return list based on many different criteria. Quite often you may wish to combine lists in different ways. For example you may wish to find all appointments between Jan 1, 2004 and Jan 10, 2004. In addition you may wish to narrow it further by appointments in some room. You could also go further in depth based on provider or category. This can be done easily by combining AppointmentList objects. The code snippet below finds all objects in the date range Jan 1, 2004 through Jan 10, 2004. It also finds appointments in a particular room.
Dim room As Room room = Schedule1.RoomCollection("Room1") Dim list1 As AppointmentList Dim list2 As AppointmentList list1 = Schedule1.AppointmentCollection.Find(#1/1/2004#, #1/10/2004#) list2 = Schedule1.AppointmentCollection.Find(room) Dim listUnion As AppointmentList Dim listIntersection As AppointmentList Dim listDifference As AppointmentList 'All appointment in either list listUnion = list1.Union(list2) 'Only object that are in both lists listIntersection = list1.Intersect(list2) 'All object in list 1 minus all object in list2 listDifference = list1.Subtract(list2)

10. How do I cancel the default property dialog?
Before the default dialog is displayed the event “BeforePropertyDialog” is raised. It has a Boolean cancel parameter that may set to true to cancel the dialog.

11. How do I cancel other dialog screens?
Each dialog is displayed only after some “Before…” event is raised. You may cancel any dialog from its associated “Before…” event. The relavant events are as follows: BeforePropertyDialog, BeforeCategoryListDialog, BeforeProviderListDialog, BeforeProviderConfigurationDialog, BeforeCategoryConfigurationDialog, BeforeRoomConfigurationDialog.

12. How do I display the default dialogs?
You may display any of the built-in dialogs in code using the schedule’s “Dialogs” object. There are eight built-in dialogs and they may be displayed with the following methods: ShowAboutDialog, ShowAlarmDialog, ShowCategoryConfiguration, ShowCategoryDialog, ShowPropertyDialog, ShowProviderConfiguration, ShowProviderDialog, ShowRoomConfiguration.

13. How do I display the configuration screens?
All of the configuration screens may be displayed from code. In fact they may only be displayed from code since there is no way for the user to show them. The following code snippet displays the category, provider, and room configuration screen respectively.
Call Schedule1.Dialogs.ShowCategoryConfiguration() Call Schedule1.Dialogs.ShowProviderConfiguration() Call Schedule1.Dialogs.ShowRoomConfiguration()

14. How do I ensure a day (time, room, etc.) is visible in the viewport?
The schedule has a visibility object that can bring any portion of the schedule into the viewport. The “Show…” method take a parameter that identifies an area to display. If possible the area is brought into the viewing area. The cod snippet below ensures that a date and a time is visible.
Call Schedule1.Visibility.ShowDate(#1/1/2004#) Call Schedule1.Visibility.ShowTime(#11:00:00 AM#)

15. How do I get the first visible date (time, room, etc) in the viewport?
The schedule’s visibility object also can be used to determine what is the first date, time, etc that is visible in the top, left corner of the schedule. The code snippet below retrieves the first visible date and time for the schedule.
Dim theDate As Date = Schedule1.Visibility.FirstVisibleDate() Dim theTime As Date = Schedule1.Visibility.FirstVisibleTime()

16. How do I check for space availability?
The AppointmentList method IsAreaAvailable allows you to check if any appointment overlaps an area. If no appointment in the specified list overlaps the defined space then the method return true. If one or more appointments cover any part of the defined area then false is returned. The code below creates a list from the entire AppointmentCollection effectively verify if a schedule area is available for the whole schedule.
If Schedule1.AppointmentCollection.ToList.IsAreaAvailable(#1/1/2004#, _ #10:00:00 AM#, 60) Then 'Do Something... End If

17. How do I determine if a time slot is enabled?
Before you add an appointment in code, you may wish to determine if the time slot is inside of a NoDropArea. The schedule’s “Availability” object may be used to determine if a slot if enabled or not. The code snippet below checks to determine if Jan 1, 2004, 10:00AM for 1 hour is enabled or not.
If Schedule1.Availability.IsAreaEnabled(#1/1/2004#, _ #10:00:00 AM#, 60) Then 'Do Something... End If

18. How do I get a list of conflicts for an appointment?
The schedule’s “Availability” object allows you to get a list of all appointments that conflict wish a specified appointment. The method “ConflictList” takes an appointment as a parameter and return an AppointmentList object of appointments that conflict with the parameter. If there are no conflicts the returned object has zero object in it.
Dim al As AppointmentList al = Schedule1.Availability.ConflictList(appointment)

19. How do I determine if two appointments conflict?
The AppointmentCollection object can be used to determine if a specific appointment conflicts with any other appointment in the collection. The code snippet below demonstrates this.
Dim appointment As Appointment 'Add some appointments... If Schedule1.AppointmentCollection.IsConflict(appointment) Then 'Do Something... End If


If you wish to only check conflicts between two appointments and not the whole collection, you may use the IsConflict method of an appointment object.
Dim appointment1 As Appointment Dim appointment2 As Appointment 'Add some appointments... If appointment1.IsConflict(appointment2) Then 'Do Something... End If

20. How do I attach additional, custom information to an object (appointment, category, etc.)?
Most objects in the GbSchedule.NET framework have a child object PropertyCollection. This is a collection of name/value pairs. You may store any number of values with a key, name, and value. These are all string values. You may reference the collection by key, name, or index [0..N-1]. This collection is very useful if you have custom information that you need to associate with an object.
Dim appointment As Appointment 'Add some appointments... appointment.PropertyCollection.Add("", "MyProperty", "MyValue")

21. How do I ensure that an appointment’s 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 appointment’s 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 appointment’s length will always be between 1 and 2 hours.
Dim appointment As Appointment 'Add some an appointment… appointment.MinLength = 60 appointment.MaxLength = 120

22. How do I ensure that a specified area never receives appointments?
The NoDropAreas collection allows you to add areas of the schedule where appointments are invalid. These defined areas will be a specified color and appointments will not be allows to be moved or copied there. The code snippet below adds Jan 1, 2004 to the NoDropAreas collection. You may also define combination areas of dates, times, room, providers, etc.
Call Schedule1.NoDropAreas.Add(Color.Red, #1/1/2004#)

23. How do I set the alarm of an appointment in code?
An alarm may be displayed when an appointment comes due. The alarm may be set from the default property screen in code. In code it may be set with the code snippet below.
appointment.Alarm.IsArmed = True

24. How do I customize an appointment, i.e. make it round, change the color, Transparency, etc?
An appointment has many properties to customize it appearance. The code snippet below demonstrates some of them.
'Make the appointment half see-through appointment.Transparency = 50 'Make the backcolor light blue appointment.BackColor = Color.LightBlue 'Make the text color black appointment.ForeColor = Color.Black 'Make the border this a system color appointment.BorderColor = SystemColors.ControlDark 'Make the font bold appointment.FontBold = True 'Draw the appointment as round not rectangle appointment.IsRound = True


Each appointment also has a header object. This object may be used to define a header for the appointment and set it properties.
'Draw a line under the header appointment.Header.AllowBreak = False 'Make the backcolor red appointment.Header.BackColor = Color.Red 'Draw the appointment's date in the header appointment.Header.HeaderType = _ AppointmentHeader.HeaderTypeConstants.DateHeader 'Set the header icon to the default "Info" icon appointment.Header.Icon = Schedule1.DefaultIcons.IconInfo 'Make the appointment half see-through appointment.Header.Transparency = 50

25. How do I determine how many days an appointment spans?
Appointments may overlap any number of day boundaries. To determine the number of breaks use the “DaySpan” appointment property. This property is not the number of full days that the appointment covers. It is the number 12:00AM boundaries that the 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

26. How do I display a colored bar next to an appointment?
There are four ways to configure an appointment’s 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 appointment’s 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 appointment’s 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.BarType = _ GbSchedule.Controls.Schedule.AppointmentBarConstants.None Schedule1.AppointmentBar.BarType = _ GbSchedule.Controls.Schedule.AppointmentBarConstants.Category Schedule1.AppointmentBar.BarType = _ GbSchedule.Controls.Schedule.AppointmentBarConstants.Provider Schedule1.AppointmentBar.BarType = _ GbSchedule.Controls.Schedule.AppointmentBarConstants.UserDrawn

27. 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 exposed 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.

28. 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

29. How do I mark an appointment as read-only and have is displayed with no details visible?
If you wish to show an appointment space as taken, but do not want the user to see any details of the appointment, you should use an appointment’s BlockOut property. It ensures that the appointment drawn as a solid colored block defined by the schedule’s BlockOutColor. No text or icons are displayed on the appointment. The user cannot move, copy, or otherwise interact with the appointment. The appointment simply becomes a placeholder to inform the user that the space is taken but he has no business know any other information about the appointment.
appointment.Blockout = True

30. How do I get override the displayed header (column or row) text?
There are three events that are displayed before header are drawn: BeforeRoomHeaderDraw, BeforeProviderHeaderDraw, and BeforeDateHeaderDraw. These events allow you to change the text drawn in the header if desired. The change will not change the text permanently. It will only be changed on the screen and not in the header object.

31. How do I get notification when an appointment’s alarm comes due?
The event “BeforeAppointmentDue” is raised just before the default alarm dialog is displayed. You may cancel the dialog from this event. In addition the “BeforeAppointmentReminder” event is raised some number of minutes before (or after) the “BeforeAppointmentDue” determined by the appointment’s “Reminder” property, which is the number of minutes before an appointment to display a reminder. If this value is 0 then no reminder is displayed. If this value is negative then the reminder occurs after the appointment comes due.

32. How do I get override the displayed appointment text?
The event “BeforeAppointmentTextDraw” is raised just before each appointment’s subject text is drawn. You may change the displayed text from this event is necessary. Overriding the text will not change the appointment object Subject property. It will only change the text drawn on the screen. The change has not persistence.

33. How do I get notification when an appointment is added, copied, moved, or deleted?
There are numerous events that provide notification upon an action occurring. Many times there are complementary event that begin with “Before” and “After”. These events work in pairs to notify the container before an action occurs and after that action has occurred. In most cases the action may be canceled in the “Before…” event. Below are a few event actions and there associated events.
Action: Appointment Add
BeforeAppointmentAdd
AfterAppointmentAdd

Action: Appointment Copy
BeforeAppointmentCopy
AfterAppointmentCopy

Action: Appointment Move
BeforeAppointmentMove
AfterAppointmentMove

Action: Appointment Remove
BeforeAppointmentRemove
AfterAppointmentRemove
 

34. How do I get notification when the column or row headers are resized?
When a column or row header is resized a pair of events are raised to notify the container. Listed below is the event sequence for each.
Action: Column Resize
BeforeColumnResize
AfterColumnResize

Action: Row Resize
BeforeRowResize
AfterRowResize

35. How do I get notification when a non-appointment is dropped on the schedule?
When a non-appointment object is dropped on a schedule the event pair “BeforeForeignAdd” and “AfterForeignAdd” is raised. When the container receives these events it is a certainty that some other object has been dropped on the schedule. If this is an illegal operation then cancel the drop in the BeforeForeignAdd event.

36. How do I get notification of the user edits an appointment’s text in grid?
If the property “AllowInPlaceEdit” is set to true, the user may click an appointment to start an in-grid edit. When this text is saved the event “AfterInPlaceEdit” is raised. You may do any process you wish in this event. To cancel an in-place edit before it starts use the “BeforeInPlaceEdit” event.
 

37. How do I get notification of the user clicking an appointment’s header icon?
The event “AppointmentHeaderInfoClick” is raised when the user clicks in the header icon of an appointment. For this to happen an appointment must have a header and it must have a header icon. The following code snippet adds an appointment and creates a header and icon for it. You may wish to use a header icon to inform the user of some information. If you wish to perform any action on its click use this event.
Dim appointment As Appointment appointment.Header.HeaderType = _ AppointmentHeader.HeaderTypeConstants.DateHeader appointment.Header.Icon = Schedule1.DefaultIcons.IconInfo

38. How do I toggle the schedule time format between the 12 and 24-hour clock?
Different countries have different clock formats. The schedule will display time in both the 12-hour or 24-hour clock formats. Use the “ClockSetting” property to change the time format.
Schedule1.ClockSetting = _ GbSchedule.Controls.Schedule.ClockSettingConstants.Clock12

39. How do I resize column and row header in code?
The user may resize the column and row header in code by using the two objects: ColumnHeader and RowHeader. Each has a size property that is measured in pixels. Set the size of each using this property.
Schedule1.RowHeader.Size = 30 Schedule1.ColumnHeader.Size = 80

40. How do I make the columns (or rows) resize automatically?
If you wish for either the rows or columns to resize automatically use the AutoFit property of the ColumnHeader and RowHeader object. Keep in mind that columns and rows have a minimum size and the AutoFit will not always fir them perfectly. If you have 200 columns on your schedule, scroll bars will still be necessary and the columns will be the minimum allowable size. However for smaller sets of data this property will ensure that the number of columns or rows fits the total schedule area on screen.
Schedule1.RowHeader.AutoFit = True Schedule1.ColumnHeader.AutoFit = True

41. How do I determine if the mouse is over an appointment?
If you need to determine if the mouse is over an appointment, this is possible as well. This is quite useful in the MouseMove event. You may wish to display some information when the user moves the mouse over an appointment. The following code assumes that it is in the Schedule’s MouseMove event. It checks the “e” parameter to determine if an appointment is at the coordinates and if so displays a message.
Dim appointment As Appointment  appointment = Schedule1.Visibility.GetAppointmentFromCor(e.X, e.Y) If Not (appointment Is Nothing) Then Debug.WriteLine(“Over an appointment!”) End If

42. How do I customize conflict displays?
In many cases, conflicting appointments are a part of life. GbSchedule.Net allows you to display conflicts in three different ways. (1) They can be overlapped. Essentially this is no processing since appointment merely overlap others that conflict. (2) They can be displayed side-by-side. This ensures that all appointments are seen. Each appointment is drawn a smaller width to allow other conflicting appointments to be seen. (3) An advanced display is staggering. Appointments are slightly overlapped but there width as slightly smaller as well. This looks much like the iCal application from Apple.
Schedule1.ConflictDisplay = _ GbSchedule.Controls.Schedule.ConflictDisplayConstants.Overlap Schedule1.ConflictDisplay = _ GbSchedule.Controls.Schedule.ConflictDisplayConstants.SideBySide Schedule1.ConflictDisplay = _ GbSchedule.Controls.Schedule.ConflictDisplayConstants.Stagger

43. How do I print or preview a schedule?
A schedule may be print as easily as calling the GoPrint method. However this method is overloaded and may take a “PrintDialogSettings” object to customize the area of print. Previewing the schedule works the same way. It is overloaded in the exact same way as the GoPrint method.
Schedule1.GoPrint() Schedule1.GoPreview()

44. How do I get notification of printing progress?
When printing or previewing is started there are two events that come into play. The first is the “PrintProgress” event. It has numerous properties on its parameter object. You may find out the current page being printed as well as the total number of pages that will be printed. You may also cancel the print from this event. That is where the second event comes into play. If you cancel the print then the “PrintCanceled” event is raised to notify you that the print has stopped before completing.
45. How do I customize the appointment dialog?
The appointment property dialog maybe customized in code. Before the dialog appears the BeforePropertyDialog event is raised. It has a parameter named DialogSettings. This is the dialog configuration object. It has numerous properties that may be set to customize the dialog. The code snippet below is in this event. It toggles some features on and others off. It also displays a warning message in the dialog as well.
e.DialogSettings.AllowMasterCategories = False e.DialogSettings.AllowNavigate = False e.DialogSettings.AllowModal = True e.DialogSettings.WarningText = "Sample Text"

46. How do I build a custom search screen?
When you build a custom search screen, there will be numerous criteria. You may search on dates, room, categories, providers, or text. This is very complicated. The schedule allows you do many small searches and then perform other operations on the results of these searches. The code snippet below creates an AppointmentList of all appointments in a date range. It then creates a second AppointmentList of all appointment in Room 3. We then have two lists. Depending on what you wish to do, you call different methods of the AppointmentList object. If you wish to find only appointments that match both criteria then use the Intersect method to create a master AppointmentList. If you wish to find appointments that match either then use the Union method. If you wish to find all in list 1 minus any in list 2 use the Subtract method.
'Get all appointments between Jan 1-10 2004 Dim al1 As New AppointmentList() al1 = Schedule1.AppointmentCollection.Find(#1/1/2004#, #1/10/2004#) 'Get all appointments for Room 3 Dim al2 As New AppointmentList() Dim room As Room room = Schedule1.RoomCollection(2) al2 = Schedule1.AppointmentCollection.Find(room) 'Intesect the lists  Dim intersectList As New AppointmentList() intersectList = al1.Intersect(al2) 'Intesect the lists  Dim unionList As New AppointmentList() unionList = al1.Union(al2) 'Subtract the lists  Dim subtractList As New AppointmentList() subtractList = al1.Subtract(al2)

47. How do I get notification when an appointment has been selected?
The BeforeSelectedItemChangea and AfterSelectedItemChange events are raised when an appointment has been selected. In the first event you may cancel the selection. The second event is raised after the selected and repainting of the screen. It is merely a notification event.

48. How do I get notification when a column or row is resized?
The BeforeColumnResize and AfterColumnResize events are raised when the user resizes a column. All columns are the same width, so really all columns are resized at the same time. You may cancel the resize in the BeforeColumnResize event. The AfterColumnResize event is raised after the resize and all screen painting is complete. The complementing events for resizing row are BeforeRowResize and AfterRowResize. They serve the same function.

49. How do I color an area of the schedule?
The schedule has a ColoredAreaCollection object. This is a set of schedule areas that are defined with colors. This is quite useful functionality when you wish to covey to the user some information with color. For example each day 9AM-11AM you may schedule only one type of appointment. In this case, you color this area to visually remind the user of this fact.
'Color a date only Schedule1.ColoredAreaCollection.Add(Color.Red, #1/1/2004#) ' Color a time only Schedule1.ColoredAreaCollection.Add(Color.Red, #12:00:00 PM#, 60) ' Color a date and time  Schedule1.ColoredAreaCollection.Add(Color.Red, #1/1/2004#, _ #12:00:00 PM#, 60)

50. How do I get notification when the user clicks a colored area?
When the user clicks on an area defined in the ColoredAreaCollection object, it raises the event ColoredAreaClick. This event allows you to perform any processing you may wish to do when the user clicks one of these defined areas. There is also a complementary event for the NoDropCollection called NoDropAreaClick.

51. How do I toggle the schedule grid on and off?
If you wish to turn off the schedule grid, you may use the AllowGrid property. When this property value is set to false, no grid is displayed.

52. How do I disallow non-appointment drops?
By default anything can be dropped on the schedule. When dropped it automatically becomes an appointment of the default length. You can toggle this functionality off with the AllowForeignDrops property value. When set to false only appointment objects may be dropped on the schedule canvas.

53. How do I toggle the selector on and off?
The schedule has a selector that may be used by the user to highlight a schedule area. This is useful because the user can highlight an area and press the <ENTER> key to add a new appointment. You may toggle this functionality on and off with the AllowSelector property value. 

54. How do I know what area of the schedule is selected?
When the AllowSelector property value is true the selector is visible. The Selector object controls it. It stores the current color, column, row, and length of the selector. There are read-write properties and may be used to set as well as read the current position of the selector. The following code will set the selector’s column and row. It will also set its color to red and ensure that is covers the grid cells.
Schedule1.Selector.Color = Color.Red Schedule1.Selector.Column = 2 Schedule1.Selector.Row = 5 Schedule1.Selector.Length = 3

55. How do I get a date from a column (or row) index?
The Visibility object has a method GetDateFromRowCol that takes a column or row index and returns the date displayed in the row or column. Whether it is the row or column depends on the viewmode. If dates are displayed on top then the returned index is a column. The code snippet below returns the date displayed in column 2.
‘Get the date from the column Schedule1.ViewMode = _ GbSchedule.Controls.Schedule.ViewModeConstants.DayTopTimeLeft Dim dt As Date = Schedule1.Visibility.GetDateFromRowCol(2)

56. How do I get a column (or row) index from a date?
The Visibility object has a method GetRowColFromDate that takes a date parameter and return the zero based row or column index of the date. Whether it is the row or column depends on the viewmode. If dates are displayed on top then the returned index is a column.
‘Get the column from the date Schedule1.ViewMode = _ GbSchedule.Controls.Schedule.ViewModeConstants.DayTopTimeLeft Dim col As Integer = Schedule1.Visibility.GetRowColFromDate(#1/1/2004#)

57. How do I access the default icons?
The schedule has a DefaultIcons object. It has many predefined icons that may be used anywhere you wish. The code below sets the icon of an appointment header to the “info” icon.
Dim appointment As Appointment ‘Add an appointment to the AppointmentCollection… appointment.Header.Icon = Schedule1.DefaultIcons.IconInfo

58. How do I associate files with an appointment?
Each appointment object has a FileCollection object. This is a collection of files that are associated with the appointment. These files may be displayed in the property dialog. The user can double click on these files to launch then in their associated viewer. You may manually add files to this collection with the “Add” method. The code snippet below demonstrates this functionality.
Dim appointment As Appointment ‘Add an appointment to the AppointmentCollection… Call appointment.FileCollection.Add("c:\test.txt")

59. How do I customize an appointment’s header?
Each appointment has an optional header that may be displayed. It has many properties that allow the appointment to take on a custom look. The code snippet below demonstrates some of the functionality.
Dim appointment As Appointment ‘Add an appointment to the AppointmentCollection… 'Display the appointment's date in the header  appointment.Header.HeaderType = _ AppointmentHeader.HeaderTypeConstants.DateHeader 'Draw a break under the header appointment.Header.AllowBreak = True 'Set the header's backcolor appointment.Header.BackColor = Color.LightBlue 'Set the header to half see-thru appointment.Header.Transparency = 50 'Set the header icon appointment.Header.Icon = Schedule1.DefaultIcons.IconInfo

60. How do I disallow appointment’s to be dropped on a schedule area?
There are areas where you will not want appointments to be scheduled, for example every day at lunch or perhaps holidays. The schedule has this functionality built-in. The NoDropAreaCollection object stores a set schedule areas to disallow appointment drops. The user will see a no-drop symbol when he drags an appointment over one of these areas. There are three examples below. The first shows how to make an entire day invalid. The second displays how to make a time for everyday invalid. The last make a time on a specific day invalid.
'Make a date invalid Schedule1.NoDropAreaCollection.Add(Color.Red, #1/1/2004#) 'Make a time invalid Schedule1.NoDropAreaCollection.Add(Color.Red, #12:00:00 PM#, 60) 'Make a date and time invalid Schedule1.NoDropAreaCollection.Add(Color.Red, #1/1/2004#, _ #12:00:00 PM#, 60)

61. How do I ensure that an appointment (room, provider, or time) is in view?
The schedule has numerous methods to show objects. The visibility object has the methods: ShowAppointment, ShowProvider, and ShowRoom. These may be used to display their appropriate objects. These methods depend on the viewmode as well. For example if the viewmode does not display rooms then calling the ShowRoom method will have no effect on the schedule.

62. How do I get the number of visible columns or rows?
If you need the total number of columns or rows on the schedule, this information is available. The TotalColumnCount and TotalRowCount methods of the Visibility object may be used to retrieve this information.
Dim tc As Integer = Schedule1.Visibility.TotalColumnCount Dim tr As Integer = Schedule1.Visibility.TotalRowCount

63. How do I make an appointment appear in the event header?
Events are appointments with no defined start or end time. Actually they start at midnight and last 24 hours. However they are displayed in the event header. The user cannot edit the appointment’s start or end time from the default property screen. An appointment is an event if its “IsEvent” property is set to true.

64. How can I sort a list of appointments in chronological order?
An AppointmentList object is different from an AppointmentCollection. The former may have objects added to it directly. The latter actually creates an object and returns it from the Add method. The AppointmentList object holds objects that already exist in the AppointmentCollection. You may add any number objects to the AppointmentList object. Since appointments may be added to the AppointmentCollection in any order they will most likely not be sorted. You may need to have all appointments sorted by date and time not by the order in which they were added. The code snippet below demonstrates how to get a sorted list of appointments. You may create an empty AppointmentList object and add the appointments you wish or you may load the entire AppointmentCollection when you create the object. The code below creates an AppointmentList object with all appointments, sorts them, and displays them.
'Create a list with ALL appointments Dim al As New AppointmentList(Schedule1.AppointmentCollection) Call al.Sort() 'Display all of the appointments Dim appointment As Appointment For Each appointment In al Call Debug.WriteLine(appointment.Subject) Next

65. How do I set the maximum length of the fields on the default dialog?
The default dialog screen displays three text fields: Subject, Notes, and Text. By default these fields have no maximum length. If you wish to save these fields to a database then you will most likely want to limit the number of characters that the user may enter. This ensures that you will never have more characters than you can save to your database. The code below assumes that you have a database with field length set to 100 characters for Subject, Notes, and Text. The code will display the default dialog for the first appointment in the AppointmentCollection.
Dim appointment As Appointment = Schedule1.AppointmentCollection(0) Dim dialogSettings As New AppointmentDialogSettings dialogSettings.SubjectLength = 100 dialogSettings.NotesLength = 100 dialogSettings.TextLength = 100 Schedule1.Dialogs.ShowPropertyDialog(appointment, dialogSettings)

66. How do I display N columns on my schedule, but scroll M columns at a time?
By default the schedule scrolls one column at a time. If you wish the smallest increment of scroll to be greater than 1 then you need to use the ColumnHeader object’s FrameIncrement. This value in conjunction with the AutoFit property sets the schedule to disallow column resizing and to scroll one “frame” at a time. The code snippet below displays a whole year on a schedule. The first date is on a Sunday and the last date is on a Saturday. We wish for the user to scroll one week at a time so we set the FrameIncrement property to 7, since one column is one day. The left-most column will always be Sunday. This allows you to setup a schedule that displays a week at a time, while still allowing you to have a much larger total range of days on a schedule.
Schedule1.SetMinMaxDate(#1/4/2004#, #12/25/2004#) Schedule1.ViewMode = Gravitybox.Controls. Schedule.ViewModeConstants.DayTopTimeLeft Schedule1.ColumnHeader.AutoFit = True Schedule1.ColumnHeader.FrameIncrement = 7


67. How do I show one grid resolution but move my appointment with another resolution?
The "TimeIncrement" property determines the grid resolution. This means that it this property is set to 20, you will see three grid cells per hour, because 20 minutes multiplied by three is 60 minutes per hour. By default, when you move an appointment it is moved in these increments. This means that you can only move an appointment to some grid position that ends in ":00", ":20", or ":40" minutes. If you want to move the appointment at a different resolution then use the "AppointmentTimeIncrement" as well. This property determines the resolution of appointment drags. By default it is the same value as the TimeIncrement property though it need not be. In the above example if the AppointmentTimeIncrement is set to 5 then you could move appointments in 5 minute increments even though the grid is displayed in 20 minute increments.

68. How do I control appointment resizing?
In addition to controlling the absolute minimum and maximum appointment length (see 21 above), you can also control which edge of an appointment is resized. The "AppointmentResizing" property allows to dictate the way in which the user can resize. There are four settings: All, Length, StartTime, None. When set to "Length" on the length of the appointment can be resized. In the standard dates on top, time on left viewmode this means that on the bottom of appointments can be dragged to a new position. When AppointmentResizing is set to StartTime, ten just the opposite is true on the starting time (top) of the appointment can be changed and not the length. The "All" settings allows both and the "None" settings toggles off resizing altogether.

69. How do I control the space between appointments?
The "AppointmentSpace" property allows you to place some space between the conflicting appointments in the same column (or row). When two appointments conflict they are drawn next to each other and touching if this property is zero. The larger this property is the more space is between conflicting appointments. This property is the number of pixels between appointments.

70. How do I deploy the schedule with application?
Microsoft has made it very easy to deploy third-party components with your application. When you create a Setup and Deployment project using VS.NET, select the project node in the project tree and click the menu Project | Add | Merge Module. Select the Gravitybox Schedule.NET merge module in your install folder. This will integrate the Schedule.NET component into your application's installation.
71. How do I use the provided Merge Module?
Gravitybox provide a Merge Module for you to use when deploying your application that uses a Gravitybox Schedule.NET component. This contains the DLL and there is no need to include the actual DLL in your install project. You simple add the Merge Module to your install project and the DLL is automatically included. For more information click on the link below.
MSDN: Using Merge Modules