Fires when the user clicks on the control.

Parameters

ParameterDescription
MonthThe month clicked
WeekThe week number cliicked
DayOfWeekThe day of week clicked
DateThe date clicked
PointThe mouse cursor location
ButtonThe mouse button used to click
ShiftIndicates whether or not the SHIFT key is down
ControlIndicates whether or not the CTRL key is down

Remarks

The OnClick event fires when the user clicks anywhere on the control.

First Four Parameters

The first four parameters are critical in determining which element of the control was clicked. There are five distinguishable elements of the control that can be clicked: control, month, day of week, week number, and date.

Control:

When Month, Week, DayOfWeek, and Date are all empty, then the user has clicked on the control itself, outside of any month or other button.

Month:

When Month has a value but Week, DayOfWeek, and Date are empty, then the user has clicked within the bounds of a month, but not any specific element of the month. Note: this will also be the case if the user clicks anywhere on the month header.

Week Number:

When Month and Week have values but DayOfWeek and Date are empty, then the user has clicked on a week number along the left side of the month. Note: this will be the case even if ShowWeekNumbers is off.

Day of Week:

When Month and DayOfWeek have values but Week and Date are empty, then the user has clicked on a day of the week indicator just below the month header.

Date:

When Month, Week, DayOfWeek, and Date have values, then the user has clicked on a specific day.

Supplemental Parameters:

The remaining parameters identify the state of various objects when the click occured. The Point parameter identifies the location of the mouse cursor relative to the control's upper left hand corner. The Button parameter names the mouse button used to execute the click and will be "Left", "Middle", or "Right". TheShift and Control parameters indicate whether or not the SHIFT or CTRL keys respectively where pressed during the click. Is such cases, they will be set to 1.'

Example

Transfer Param1 to Month 
Transfer Param2 to Week 
Transfer Param3 to DayOfWeek 
Transfer Param4 to Date 
Transfer Param5 to Point 
Transfer Param6 to Button 
Transfer Param7 to Shift 
Transfer Param8 to Ctrl 

// Did the user click a date? 
DateClicked = (Month NE "" AND Week NE "" AND DayOfWeek NE "" AND Date NE "") 

// Did the user click only a week number? 
WeekNumberClicked = (Month NE "" AND Week NE "" AND DayOfWeek EQ "" AND Date EQ "") 

// Did the user click only a day of week? 
DayOfWeekClicked = (Month NE "" AND Week EQ "" AND DayOfWeek NE "" AND Date EQ "") 

// Did the user click only a month 
MonthClicked = (Month NE "" AND Week EQ "" AND DayOfWeek EQ "" AND Date EQ "") 

// Did the user click on an empty portion of the control 
ControlClicked = (Month EQ "" AND Week EQ "" AND DayOfWeek EQ "" AND Date EQ "")

See Also

OnDblClick

  • No labels