VERSION 5.00
Object = "{8E27C92E-1264-101C-8A2F-040224009C02}#7.0#0"; "MSCAL.OCX"
Begin VB.Form Form1 
   Caption         =   "设置系统日期"
   ClientHeight    =   4095
   ClientLeft      =   60
   ClientTop       =   450
   ClientWidth     =   5595
   LinkTopic       =   "Form1"
   ScaleHeight     =   4095
   ScaleWidth      =   5595
   StartUpPosition =   3  '窗口缺省
   Begin VB.CommandButton Command1 
      Caption         =   "设置系统日期"
      Height          =   600
      Left            =   300
      TabIndex        =   1
      Top             =   3270
      Width           =   1350
   End
   Begin MSACAL.Calendar Calendar1 
      Height          =   3045
      Left            =   180
      TabIndex        =   0
      Top             =   120
      Width           =   5340
      _Version        =   524288
      _ExtentX        =   9419
      _ExtentY        =   5371
      _StockProps     =   1
      BackColor       =   -2147483633
      Year            =   2004
      Month           =   2
      Day             =   23
      DayLength       =   0
      MonthLength     =   0
      DayFontColor    =   0
      FirstDay        =   1
      GridCellEffect  =   1
      GridFontColor   =   10485760
      GridLinesColor  =   -2147483632
      ShowDateSelectors=   -1  'True
      ShowDays        =   -1  'True
      ShowHorizontalGrid=   -1  'True
      ShowTitle       =   -1  'True
      ShowVerticalGrid=   -1  'True
      TitleFontColor  =   10485760
      ValueIsNull     =   0   'False
      BeginProperty DayFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "宋体"
         Size            =   9
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      BeginProperty GridFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "宋体"
         Size            =   9
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      BeginProperty TitleFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "宋体"
         Size            =   12
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
   End
   Begin VB.Label Label1 
      Caption         =   "Label1"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   12
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   1875
      TabIndex        =   2
      Top             =   3405
      Width           =   3480
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
    Dim D As Integer, M As Integer, Y As Integer    '定义日、月、年变量
    Dim strDay As String                            '定义字符串变量以存储日期字符串
    D = Calendar1.Day                               '取得日期值
    M = Calendar1.Month                             '取得月份值
    Y = Calendar1.Year                              '取得年份值
    strDay = Str(Y) + Str(M) + Str(D)               '将年、月、日值连接起来形成日期字符串
    Date = CDate(strDay)                            '将日期字符串转换为日期，并设置为系统日期
    Label1.Caption = "系统时间被设置为：" + strDay  '在标签中显示设置后的日期
End Sub
