?? frmsysdate.frm
字號:
VERSION 5.00
Begin VB.Form frmSysDate
BorderStyle = 3 'Fixed Dialog
Caption = "系統(tǒng)日期"
ClientHeight = 870
ClientLeft = 45
ClientTop = 330
ClientWidth = 5415
ControlBox = 0 'False
Icon = "frmSysDate.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 870
ScaleWidth = 5415
ShowInTaskbar = 0 'False
StartUpPosition = 1 '所有者中心
Begin VB.CommandButton OKButton
Caption = "確定"
Height = 375
Left = 4020
TabIndex = 0
Top = 240
Width = 1215
End
Begin VB.TextBox Text1
Height = 315
Index = 0
Left = 1620
MaxLength = 4
TabIndex = 1
Top = 240
Width = 495
End
Begin VB.TextBox Text1
Height = 315
Index = 1
Left = 2400
MaxLength = 2
TabIndex = 2
Top = 240
Width = 315
End
Begin VB.TextBox Text1
Height = 315
Index = 2
Left = 3000
MaxLength = 2
TabIndex = 3
Top = 240
Width = 315
End
Begin VB.Label Label1
Alignment = 1 'Right Justify
Caption = "請輸入系統(tǒng)日期:"
Height = 195
Index = 0
Left = 120
TabIndex = 7
Top = 300
Width = 1455
End
Begin VB.Label Label1
Caption = "日"
Height = 195
Index = 1
Left = 3360
TabIndex = 6
Top = 300
Width = 195
End
Begin VB.Label Label1
Caption = "月"
Height = 195
Index = 2
Left = 2760
TabIndex = 5
Top = 300
Width = 195
End
Begin VB.Label Label1
Caption = "年"
Height = 195
Index = 3
Left = 2160
TabIndex = 4
Top = 300
Width = 195
End
End
Attribute VB_Name = "frmSysDate"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Form_Load()
Text1(0).Text = Year(Date)
Text1(1).Text = Month(Date)
Text1(2).Text = Day(Date)
Text1(0).SelStart = 0
Text1(0).SelLength = Len(Text1(0).Text)
End Sub
Private Sub OKButton_Click()
Dim strCurDate As String
strCurDate = Trim(Me.Text1(0).Text) & "-" & Trim(Me.Text1(1).Text)
strCurDate = strCurDate & "-" & Trim(Me.Text1(2).Text)
If Not IsDate(strCurDate) Then
MsgBox "日期輸入錯誤!", vbCritical, "系統(tǒng)日期"
Me.Text1(0).SelStart = 0
Me.Text1(0).SelLength = Len(Me.Text1(0).Text)
Me.Text1(0).SetFocus
Else
dteSysDate = CDate(strCurDate)
Unload Me
End If
End Sub
Private Sub Text1_KeyPress(Index As Integer, KeyAscii As Integer)
Dim strValid As String
strValid = "0123456789"
If KeyAscii = 13 Then
If Index < 2 Then
Text1(Index + 1).SelStart = 0
Text1(Index + 1).SelLength = Len(Text1(Index + 1).Text)
Text1(Index + 1).SetFocus
Else
Me.OKButton.SetFocus
End If
End If
If KeyAscii > 26 Then
If InStr(strValid, Chr(KeyAscii)) = 0 Then
KeyAscii = 0
End If
End If
' Select Case Index
' Case 1
' If Text1(Index).Text < 1 Or Text1(Index).Text > 12 Then
' End If
' End Select
End Sub
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -