VERSION 5.00 Begin VB.PropertyPage ppAppearance Caption = "Appearance" ClientHeight = 3405 ClientLeft = 0 ClientTop = 0 ClientWidth = 6375 LockControls = -1 'True PaletteMode = 0 'Halftone ScaleHeight = 3405 ScaleWidth = 6375 Begin VB.Frame Frames Caption = "Days of Week" Height = 1695 Index = 0 Left = 120 TabIndex = 4 Top = 1560 Width = 2355 Begin VB.ComboBox cbxStartOfWeek Height = 315 Left = 120 Style = 2 'Dropdown List TabIndex = 8 Top = 1260 Width = 2115 End Begin VB.ComboBox cbxDayFormat Height = 315 ItemData = "Appear.pgx":0000 Left = 120 List = "Appear.pgx":000D Style = 2 'Dropdown List TabIndex = 6 Top = 540 Width = 2115 End Begin VB.Label Labels AutoSize = -1 'True Caption = "Start Of Week:" Height = 195 Index = 0 Left = 120 TabIndex = 7 Top = 1020 Width = 1065 End Begin VB.Label Labels AutoSize = -1 'True Caption = "Day Name Format:" Height = 195 Index = 1 Left = 120 TabIndex = 5 Top = 300 Width = 1320 End End Begin VB.Frame Frames Caption = "Preview" Height = 3135 Index = 2 Left = 2640 TabIndex = 9 Top = 120 Width = 3615 Begin MSVBCalendar.Calendar calPreview Height = 2775 Left = 240 TabIndex = 10 Top = 240 Width = 3255 _ExtentX = 5741 _ExtentY = 4895 Day = 12 Month = 9 Year = 1996 BeginProperty DayNameFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} Name = "MS Sans Serif" Size = 8.25 Charset = 0 Weight = 700 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty BeginProperty DayFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} Name = "MS Sans Serif" Size = 8.25 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Locked = -1 'True End End Begin VB.Frame Frames Caption = "Navigation" Height = 1335 Index = 1 Left = 120 TabIndex = 0 Top = 120 Width = 2355 Begin VB.CheckBox chkShowIterration Caption = "Show Iterration Buttons" Height = 195 Left = 180 TabIndex = 3 Top = 960 Width = 1995 End Begin VB.CheckBox chkYearRO Caption = "Year Read-Only" Height = 195 Left = 180 TabIndex = 2 Top = 630 Width = 1695 End Begin VB.CheckBox chkMonthRO Caption = "Month Read-Only" Height = 195 Left = 180 TabIndex = 1 Top = 300 Width = 1695 End End End Attribute VB_Name = "ppAppearance" Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = True Attribute VB_PredeclaredId = False Attribute VB_Exposed = True '---------------------------------------------------------------------- ' Appearance.pag '---------------------------------------------------------------------- ' Implementation file for the appearance property page ' for the VB calendar control. '---------------------------------------------------------------------- ' Copyright (c) 1996, Microsoft Corporation ' All Rights Reserved ' ' Information Contained Herin is Proprietary and Confidential '---------------------------------------------------------------------- Option Explicit '====================================================================== ' Private Data Members '====================================================================== '====================================================================== ' Private Event Handles '====================================================================== '---------------------------------------------------------------------- ' SelectionChanged Event '---------------------------------------------------------------------- ' Purpose: Called when the selected controls are changed ' set all controls to reflect property settings ' of the selected control(s) ' Inputs: None ' Outputs: None '---------------------------------------------------------------------- Private Sub PropertyPage_SelectionChanged() Dim cal As Calendar 'reference to selected ctl Dim ctl As Control If PropertyPage.SelectedControls.Count = 0 Then 'daveste -- 8/16/96 'REVIEW: 'what the heck do we do here? Else 'get the first selected control (might be the only) Set cal = PropertyPage.SelectedControls(0) 'load the start of week combo LoadStartOfWeekCombo 'set the control's values according to current 'property settings chkMonthRO.Value = Abs(cal.MonthReadOnly) chkYearRO.Value = Abs(cal.YearReadOnly) chkShowIterration.Value = Abs(cal.ShowIterrationButtons) calPreview.MonthReadOnly = cal.MonthReadOnly calPreview.YearReadOnly = cal.YearReadOnly calPreview.ShowIterrationButtons = cal.ShowIterrationButtons cbxDayFormat.ListIndex = cal.DayNameFormat cbxStartOfWeek.ListIndex = cal.StartOfWeek 'setting list index on the combos triggers the 'Click event so we don't need to set the 'preview's props since they will be set in the 'click events themselves 'reset the control's data changed state 'so they are clean On Error Resume Next For Each ctl In PropertyPage.Controls ctl.datachange = False Next 'initialize the page's change flag to false PropertyPage.Changed = False End If 'no controls selected End Sub 'PropertyPage_Load() '---------------------------------------------------------------------- ' ApplyChanges Event '---------------------------------------------------------------------- ' Purpose: Called when the user applies changes to the property ' settings. Set properties of the selected control(s) ' Inputs: None ' Outputs: None '---------------------------------------------------------------------- Private Sub PropertyPage_ApplyChanges() Dim cal As Calendar 'get the control to set properties on Set cal = PropertyPage.SelectedControls(0) 'set the properties if they've changed If chkMonthRO.DataChanged Then cal.MonthReadOnly = CBool(chkMonthRO.Value) End If If chkYearRO.DataChanged Then cal.YearReadOnly = CBool(chkYearRO.Value) End If If chkShowIterration.DataChanged Then cal.ShowIterrationButtons = CBool(chkShowIterration.Value) End If If cbxDayFormat.DataChanged Then cal.DayNameFormat = cbxDayFormat.ListIndex End If If cbxStartOfWeek.DataChanged Then cal.StartOfWeek = cbxStartOfWeek.ListIndex End If End Sub 'PropertyPage_ApplyChanges() '---------------------------------------------------------------------- ' LoadStartOfWeekCombo() '---------------------------------------------------------------------- ' Purpose: Loads the start of week combo box with the names of the ' week days in the local language ' Inputs: None ' Outputs: None '---------------------------------------------------------------------- Private Sub LoadStartOfWeekCombo() Dim nDay As Long 'add the "use system" option first 'daveste -- 8/16/96 'TODO: Add code for getting this out of the string table cbxStartOfWeek.AddItem "Use System" 'add the long day names For nDay = 1 To 7 cbxStartOfWeek.AddItem Format(DateSerial(1996, 8, 3 + nDay), "dddd") Next nDay End Sub 'LoadStartOfWeekCombo() '---------------------------------------------------------------------- ' chkMonthRO_Click Event '---------------------------------------------------------------------- ' Purpose: Called when the user changes the state of the month ' read-only check box. ' Inputs: None ' Outputs: None '---------------------------------------------------------------------- Private Sub chkMonthRO_Click() 'change the preview calPreview.MonthReadOnly = CBool(chkMonthRO.Value) 'set the page's change flag to True PropertyPage.Changed = True End Sub 'chkMonthRO_Click() '---------------------------------------------------------------------- ' chkYearRO_Click Event '---------------------------------------------------------------------- ' Purpose: Called when the user changes the state of the year ' read-only check box. ' Inputs: None ' Outputs: None '---------------------------------------------------------------------- Private Sub chkYearRO_Click() 'change the preview calPreview.YearReadOnly = CBool(chkYearRO.Value) 'set the page's change flag to True PropertyPage.Changed = True End Sub 'chkYearRO_Click() '---------------------------------------------------------------------- ' chkShowIterration_Click Event '---------------------------------------------------------------------- ' Purpose: Called when the user changes the state of the show ' iterration buttons check box ' Inputs: None ' Outputs: None '---------------------------------------------------------------------- Private Sub chkShowIterration_Click() 'change the preview calPreview.ShowIterrationButtons = CBool(chkShowIterration.Value) 'set the page's change flag to True PropertyPage.Changed = True End Sub 'chkShowIterration_Click() '---------------------------------------------------------------------- ' cbxStartOfWeek_Click Event '---------------------------------------------------------------------- ' Purpose: Called when the user changes the selected item in the ' start of week combo box ' Inputs: None ' Outputs: None '---------------------------------------------------------------------- Private Sub cbxStartOfWeek_Click() 'change the preview calPreview.StartOfWeek = cbxStartOfWeek.ListIndex 'set the page's change flag to True PropertyPage.Changed = True End Sub 'cbxStartOfWeek_Click() '---------------------------------------------------------------------- ' cbxDayFormat_Click Event '---------------------------------------------------------------------- ' Purpose: Called when the user changes the selected item in the ' day format combo box ' Inputs: None ' Outputs: None '---------------------------------------------------------------------- Private Sub cbxDayFormat_Click() 'change the preview calPreview.DayNameFormat = cbxDayFormat.ListIndex 'set the page's change flag to True PropertyPage.Changed = True End Sub 'cbxDayFormat_Click()