pocket programs

Home
Products
Download
Licences
Support
Contact
DateTimePicker
MonthCal
-Methods
-Styles
-Constants
-Example
Trackbar
Up-Down
Keypad
Sketch
Progressbar
Buy-Now
Support
Contact

MonthCalendar (MonthCal)

The MonthCal control embeds a Calendar in the curent form. The calendar can be used to select single or multiple dates.

MonthCal - Methods & Properties

NewMonthCal

long hWnd = PPCtrl.MonthCal(hWnd, dwStyle)

Creates a new MonthCal and returns the handle of the new control.

hWnd hWnd of parent form (or frame) or placeholder (hWnd)
DwStyle Specifies the style of the window being created.
If the style PC_PLACEHOLDER is specified, then hWnd refers to the control to be used as a as placeholder. The new MonthCal control will be placed on the form at the same location as this control. The place-holder control is then hidden. Note: If PC_PLACEHOLDER style is not given, then hWnd specifies the parent window for the new control. The new control is positioned according to the current values of PPCtrl.Left, PPCtrl.Top, PPCtrl.Width and PPCtrl.Height.
MC1 = PPCtrl.MonthCal(hWnd, WS_BORDER + DTS_LONGDATEFORMAT + PC_PLACEHOLDER)<br> MC1 = PPCtrl.MonthCal(Frame1.hWnd, WS_BORDER + DTS_TIMEFORMAT, 0)

Date

PPCtrl.Date(hWNd) = date Date = PPCtrl.Date(hWnd)

Retrieves/Sets the currently selected time from the month calendar control specified by hWnd.

PPCtrl.Date(MC1)=now<br> SelDate=PPCtrl.Date(MC1)

MinDate, MaxDate

PPCtrl.MinDate(hWnd) = date PPCtrl.MaxDate(hWnd) = date Date = PPCtrl.MinDate(hWnd) Date = PPCtrl.MaxDate(hWnd)

Retrieves/Sets the current minimum and maximum allowable times/dates for the month calendar control specified by hWnd.

PPCtrl.MinDate(MC1) = DateSerial(2000,1,1)<br> PPCtrl.MaxDate(MC1) = DateSerial(2099,12,31)<br> FromDate = PPCtrl.MinDate(MC1)

FirstDayOfWeek

PPCtrl.FirstDayOfWeek(hWnd) = int<br> int = PPCtrl.FirstDayOfWeek(hWnd)

Retrieves the first day of the week of the month calendar control specified by hWnd.

Value
Day
0
Monday
1
Tuesday
2
Wednesday
3
Thursday
4
Friday
5
Saturday
6
Sunday
PPCtrl.FirstDayOfWeek(MC1)=6

MaxSelCount

PPCtrl.MaxSelCount(hWnd) = int<br> Int=PPCtrl.MaxSelCount(hWnd)

Sets the maximum number of days that can be selected in the month calendar control specified by hWnd. Default 7 days. Only valid with window style MCS_MULTISELECT.

PPCtrl.MaxSelDays(MC1)=14

DateSelMax, DateSelMin

PPCtrl.DateSelMin(hWnd) = Date<br> PPCtrl.DateSelMax(hWnd) = Date<br> Date = PPCtrl.DateSelMin(hWnd)<br> Date = PPCtrl.DateSelMin(hWnd)

Sets the selection for the month calendar control specified by hWNd to a given date range. Only valid valid with window style MCS_MULTISELECT. If the date range specified exceeds the number of days set in PPCtrl.MaxSelCount, the range will be automatically adjusted.

PPCtrl.DateSelMin(MC1)=DateSerial(2003,02,06)<br> PPCtrl.DateSelMax(MC1)=DateSerial(2003,02,12)

MonthCal – Styles

MCS_MULTISELECT

The month calendar will allow the user to select a range of dates within the control. By default, the maximum range is one week. You can change the maximum range that can be selected by using the PPCtrl.MaxSelCount property

MCS_NOTODAY

The month calendar control will not display the "today" date at the bottom of the control.

MCS_NOTODAYCIRCLE

The month calendar control will not circle the "today" date.

MCS_WEEKNUMBERS

The month calendar control will display week numbers (1-52) to the left of each row of days. Week 1 is defined as the first week that contains at least four days.


MonthCal - Constants

Const MCS_MULTISELECT = &H2 ' allow selection of a date range Const MCS_WEEKNUMBERS = &H4 ' show week numbers on the calendar Const MCS_NOTODAYCIRCLE = &H8 ' do not circle today Const MCS_NOTODAY = &H10 ' do not show today: on calendar

MonthCal - Example

Dim PPCtrl As Object Set PPCtrl = CreateObject("PPControl.Controls") DatePicker = PPCtrl.NewMonthCal(hWnd, _ MCS_MULTIFORMAT + WS_BORDER, Text2.hWnd) PPCtrl.firstdayofweek(MonthCal) = 5 PPCtrl.maxselcount(MonthCal) = 14 PPCtrl.dateselmin(MonthCal) = DateSerial(2003, 2, 6) PPCtrl.dateselmax(MonthCal) = DateSerial(2003, 2, 12) PPCtrl.MinDate(MonthCal) = DateSerial(2003, 1, 9) PPCtrl.MinDate(MonthCal) = DateSerial(2003, 12, 31)