📄 frm_time_set.frm
字号:
VERSION 5.00
Object = "{86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCT2.OCX"
Begin VB.Form Frm_time_set
Caption = "设置数据库备份的向导"
ClientHeight = 4140
ClientLeft = 60
ClientTop = 345
ClientWidth = 5400
Icon = "Frm_time_set.frx":0000
LinkTopic = "Form5"
MaxButton = 0 'False
ScaleHeight = 4140
ScaleWidth = 5400
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton cmdNav
Caption = "上一步(&N)"
Height = 312
Index = 2
Left = 1560
MaskColor = &H00000000&
TabIndex = 5
Tag = "103"
Top = 3480
Width = 1092
End
Begin VB.CommandButton cmdNav
Cancel = -1 'True
Caption = "取消"
Height = 312
Index = 1
Left = 240
MaskColor = &H00000000&
TabIndex = 3
Tag = "101"
Top = 3480
Width = 1092
End
Begin VB.CommandButton cmdNav
Caption = "下一步(&N)"
Height = 312
Index = 3
Left = 3000
MaskColor = &H00000000&
TabIndex = 2
Tag = "103"
Top = 3480
Width = 1092
End
Begin VB.CommandButton cmdNav
Caption = "完成(&F)"
Height = 312
Index = 4
Left = 4200
MaskColor = &H00000000&
TabIndex = 1
Tag = "104"
Top = 3480
Width = 1092
End
Begin VB.Frame Frame2
Caption = "设置自动备份的时间:"
Height = 2415
Left = 240
TabIndex = 0
Top = 720
Width = 5055
Begin VB.TextBox Txt_week
Alignment = 2 'Center
Height = 375
Left = 2160
TabIndex = 14
Text = "Txt_week"
Top = 1080
Width = 615
End
Begin VB.OptionButton Opt_week
Caption = "每周"
Height = 375
Left = 480
TabIndex = 13
Top = 1080
Width = 1095
End
Begin VB.TextBox Txt_month
Alignment = 2 'Center
Height = 375
Left = 2160
TabIndex = 9
Text = "Txt_month"
Top = 1680
Width = 615
End
Begin MSComCtl2.DTPicker DTP_day
Height = 375
Left = 1560
TabIndex = 8
Top = 480
Width = 1215
_ExtentX = 2143
_ExtentY = 661
_Version = 393216
Format = 23724034
CurrentDate = 38139
End
Begin VB.OptionButton Opt_month
Caption = "每月"
Height = 255
Left = 480
TabIndex = 7
Top = 1800
Width = 735
End
Begin VB.OptionButton Opt_day
Caption = "每天"
Height = 180
Left = 480
TabIndex = 6
Top = 480
Value = -1 'True
Width = 1575
End
Begin MSComCtl2.DTPicker DTP_month
Height = 375
Left = 3600
TabIndex = 12
Top = 1680
Width = 1215
_ExtentX = 2143
_ExtentY = 661
_Version = 393216
Format = 23724034
CurrentDate = 38139
End
Begin MSComCtl2.DTPicker DTP_week
Height = 375
Left = 3600
TabIndex = 15
Top = 1080
Width = 1215
_ExtentX = 2143
_ExtentY = 661
_Version = 393216
Format = 23724034
CurrentDate = 38139
End
Begin VB.Label Label5
Caption = "天"
Height = 255
Left = 3120
TabIndex = 17
Top = 1200
Width = 495
End
Begin VB.Label Label3
Caption = "第"
Height = 255
Left = 1680
TabIndex = 16
Top = 1200
Width = 375
End
Begin VB.Label Label2
Caption = "第"
Height = 255
Left = 1680
TabIndex = 11
Top = 1800
Width = 375
End
Begin VB.Label Label1
Caption = "天"
Height = 255
Left = 3120
TabIndex = 10
Top = 1800
Width = 495
End
End
Begin VB.Label Label4
Caption = "设置数据库自动备份时间:"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H8000000D&
Height = 255
Left = 120
TabIndex = 4
Top = 240
Width = 3015
End
End
Attribute VB_Name = "Frm_time_set"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub cmdNav_Click(Index As Integer)
Select Case Index
Case 0
Case 1
Unload Me
Case 2
Call Save_regedit
If Frmchoice.OptOracle = True Then
Frm_oracle_set.Show
Else
Frm_Sql_set.Show
End If
Unload Me
Case 3
Call Save_regedit
Frm_note_set.Show
Unload Me
Case 4
Call Save_regedit
Tempstr = "完成自动备份时间调度设置。"
Call writerizhi(Tempstr, Len(Tempstr))
Unload Me
End Select
End Sub
Private Sub Form_Load()
CenterForm Me
On Error GoTo errhandler
Opt_day.Value = GetSetting("databackup", "sysinformation", "Opt_day")
Opt_month.Value = GetSetting("databackup", "sysinformation", "Opt_month")
DTP_day.Value = GetSetting("databackup", "sysinformation", "DTP_day")
DTP_month.Value = GetSetting("databackup", "sysinformation", "DTP_month")
Txt_month.Text = GetSetting("databackup", "sysinformation", "Txt_month")
Opt_week.Value = GetSetting("databackup", "sysinformation", "Opt_week")
DTP_week.Value = GetSetting("databackup", "sysinformation", "DTP_week")
Txt_week.Text = GetSetting("databackup", "sysinformation", "Txt_week")
If Opt_day.Value = True Then Call Opt_day_Click
If Opt_month.Value = True Then Call Opt_month_Click
If Opt_week.Value = True Then Call Opt_week_Click
Exit Sub
errhandler:
Opt_day.Value = True
Opt_month.Value = False
Opt_week.Value = False
DTP_week.Value = Time
Txt_week.Text = "3"
DTP_day.Value = Time
DTP_month.Value = Time
Txt_month.Text = "10"
Call Opt_day_Click
End Sub
Private Sub Opt_day_Click()
DTP_month.Enabled = False
Txt_month.Enabled = False
Txt_month.BackColor = &HE0E0E0
DTP_day.Enabled = True
Txt_week.Enabled = False
Txt_week.BackColor = &HE0E0E0
DTP_week.Enabled = False
End Sub
Private Sub Opt_month_Click()
DTP_month.Enabled = True
Txt_month.Enabled = True
Txt_month.BackColor = &HFFFFFF
Txt_week.Enabled = False
Txt_week.BackColor = &HE0E0E0
DTP_week.Enabled = False
DTP_day.Enabled = False
End Sub
Private Sub Opt_week_Click()
DTP_week.Enabled = True
Txt_week.Enabled = True
Txt_week.BackColor = &HFFFFFF
Txt_month.Enabled = False
Txt_month.BackColor = &HE0E0E0
DTP_month.Enabled = False
DTP_day.Enabled = False
End Sub
Private Sub Save_regedit()
SaveSetting "databackup", "sysinformation", "Opt_day", Opt_day.Value
SaveSetting "databackup", "sysinformation", "Opt_month", Opt_month.Value
SaveSetting "databackup", "sysinformation", "DTP_day", DTP_day.Value
SaveSetting "databackup", "sysinformation", "DTP_month", DTP_month.Value
SaveSetting "databackup", "sysinformation", "Txt_month", Trim(Txt_month.Text)
SaveSetting "databackup", "sysinformation", "Opt_week", Opt_week.Value
SaveSetting "databackup", "sysinformation", "DTP_week", DTP_week.Value
SaveSetting "databackup", "sysinformation", "Txt_week", Trim(Txt_week.Text)
Call Frmmain.frmshow
End Sub
Private Sub Txt_month_KeyPress(KeyAscii As Integer)
If (KeyAscii < Asc("0") Or KeyAscii > Asc("9")) And KeyAscii <> 8 Then KeyAscii = 0
End Sub
Private Sub Txt_month_LostFocus()
If CInt(Txt_month.Text) > 31 Or CInt(Txt_month.Text) < 1 Then
MsgBox "时间设置有误,请重新设置!", vbCritical, Me.Caption
Txt_month.SetFocus
End If
End Sub
Private Sub Txt_week_KeyPress(KeyAscii As Integer)
If (KeyAscii < Asc("0") Or KeyAscii > Asc("9")) And KeyAscii <> 8 Then KeyAscii = 0
End Sub
Private Sub Txt_week_LostFocus()
If CInt(Txt_week.Text) > 7 Or CInt(Txt_week.Text) < 1 Then
MsgBox "时间设置有误,请重新设置!", vbCritical, Me.Caption
Txt_week.SetFocus
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -