📄 frmoptions.frm
字号:
VERSION 5.00
Object = "{86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCT2.OCX"
Begin VB.Form frmOptions
BorderStyle = 3 'Fixed Dialog
Caption = "选项"
ClientHeight = 3480
ClientLeft = 2565
ClientTop = 1500
ClientWidth = 6285
Icon = "frmOptions.frx":0000
KeyPreview = -1 'True
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 3480
ScaleWidth = 6285
ShowInTaskbar = 0 'False
StartUpPosition = 2 '屏幕中心
Begin VB.TextBox Text5
Height = 270
Left = 4800
TabIndex = 21
Top = 2280
Width = 495
End
Begin VB.TextBox Text4
Alignment = 1 'Right Justify
Height = 270
Left = 2160
TabIndex = 18
Top = 2280
Width = 1215
End
Begin VB.TextBox Text3
Alignment = 1 'Right Justify
Height = 270
Left = 4800
TabIndex = 15
Top = 1680
Width = 495
End
Begin VB.ComboBox Combo2
Height = 300
ItemData = "frmOptions.frx":000C
Left = 4080
List = "frmOptions.frx":0016
Style = 2 'Dropdown List
TabIndex = 14
Top = 1680
Width = 735
End
Begin VB.TextBox Text2
Alignment = 1 'Right Justify
Height = 270
Left = 2880
TabIndex = 12
Top = 1680
Width = 495
End
Begin VB.ComboBox Combo1
Height = 300
ItemData = "frmOptions.frx":0026
Left = 2160
List = "frmOptions.frx":0030
Style = 2 'Dropdown List
TabIndex = 11
Top = 1680
Width = 735
End
Begin VB.TextBox Text1
Alignment = 1 'Right Justify
Height = 270
Left = 2160
TabIndex = 8
Top = 1080
Width = 1215
End
Begin MSComCtl2.DTPicker DTP2
Height = 300
Left = 3840
TabIndex = 4
Top = 480
Width = 1095
_ExtentX = 1931
_ExtentY = 529
_Version = 393216
Format = 23724034
CurrentDate = 36891.2916666667
End
Begin MSComCtl2.DTPicker DTP1
Height = 300
Left = 2160
TabIndex = 3
Top = 480
Width = 1215
_ExtentX = 2143
_ExtentY = 529
_Version = 393216
Format = 23724034
CurrentDate = 36891.9583333333
End
Begin VB.CommandButton cmdApply
Caption = "应用"
Enabled = 0 'False
Height = 375
Left = 4920
TabIndex = 2
Top = 2895
Width = 1095
End
Begin VB.CommandButton cmdCancel
Cancel = -1 'True
Caption = "取消"
Height = 375
Left = 3720
TabIndex = 1
Top = 2895
Width = 1095
End
Begin VB.CommandButton cmdOK
Caption = "确定"
Height = 375
Left = 2520
TabIndex = 0
Top = 2895
Width = 1095
End
Begin VB.Label Label11
Caption = "元"
Height = 375
Left = 5400
TabIndex = 22
Top = 2280
Width = 255
End
Begin VB.Label Label10
Caption = "取整金额:"
Height = 375
Left = 3840
TabIndex = 20
Top = 2280
Width = 975
End
Begin VB.Label Label9
Caption = "元"
Height = 255
Left = 3480
TabIndex = 19
Top = 2280
Width = 375
End
Begin VB.Label Label8
Caption = "最低消费金额:"
Height = 375
Left = 600
TabIndex = 17
Top = 2280
Width = 1455
End
Begin VB.Label Label7
Caption = "日"
Height = 255
Left = 5400
TabIndex = 16
Top = 1680
Width = 255
End
Begin VB.Label Label6
Caption = "日 到:"
Height = 255
Left = 3360
TabIndex = 13
Top = 1680
Width = 735
End
Begin VB.Label Label5
Caption = "每月结帐时间:从:"
Height = 495
Left = 600
TabIndex = 10
Top = 1680
Width = 1815
End
Begin VB.Label Label4
Caption = "元"
Height = 255
Left = 3480
TabIndex = 9
Top = 1080
Width = 495
End
Begin VB.Label Label3
Caption = "通宵金额:"
Height = 255
Left = 600
TabIndex = 7
Top = 1080
Width = 1215
End
Begin VB.Label Label2
Caption = "到"
Height = 255
Left = 3480
TabIndex = 6
Top = 600
Width = 255
End
Begin VB.Label Label1
Caption = "通宵时间: 从"
Height = 255
Left = 600
TabIndex = 5
Top = 600
Width = 1335
End
End
Attribute VB_Name = "frmOptions"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub cmdApply_Click()
' MsgBox "在这里设置代码来设置选项 w/o 关闭对话框!"
cmdApply.Enabled = False
With frmMain.Data7.Recordset
If .EOF Then
.AddNew
Else
.Edit
End If
.Fields("通宵金额") = Val(Text1.Text)
.Fields("最低消费额") = Val(Text4.Text)
.Fields("通宵开始时间") = Format(DTP1.Value, "hh:nn:ss")
.Fields("通宵结束时间") = Format(DTP2.Value, "hh:nn:ss")
.Fields("取整金额") = Val(Text5.Text)
If Combo1.Text = Combo1.List(0) Then
.Fields("每月开始时间") = -Val(Text2.Text)
Else
.Fields("每月开始时间") = Val(Text2.Text)
End If
If Combo2.Text = Combo2.List(0) Then
.Fields("每月结束时间") = Val(Text3.Text)
Else
.Fields("每月结束时间") = -Val(Text3.Text)
End If
.Update
.MoveFirst
End With
End Sub
Private Sub cmdCancel_Click()
Unload Me
End Sub
Private Sub cmdOK_Click()
If cmdApply.Enabled = True Then
cmdApply_Click
End If
Unload Me
End Sub
Private Sub Combo1_Click()
cmdApply.Enabled = True
End Sub
Private Sub Combo2_Click()
cmdApply.Enabled = True
End Sub
Private Sub DTP1_Change()
cmdApply.Enabled = True
End Sub
Private Sub DTP2_Change()
cmdApply.Enabled = True
End Sub
Private Sub Form_Load()
'置中窗体
On Error Resume Next
Me.Move (Screen.Width - Me.Width) / 2, (Screen.Height - Me.Height) / 2
With frmMain.Data7.Recordset
Text1.Text = .Fields("通宵金额")
Text4.Text = .Fields("最低消费额")
Text2.Text = Abs(.Fields("每月开始时间"))
Text3.Text = Abs(.Fields("每月结束时间"))
Text5.Text = .Fields("取整金额")
If .Fields("每月开始时间") < 0 Then
Combo1.Text = Combo1.List(0)
Else
Combo1.Text = Combo1.List(1)
End If
If .Fields("每月结束时间") < 0 Then
Combo2.Text = Combo2.List(1)
Else
Combo2.Text = Combo2.List(0)
End If
DTP1.Value = .Fields("通宵开始时间")
DTP2.Value = .Fields("通宵结束时间")
End With
cmdApply.Enabled = False
End Sub
Private Sub Text1_Change()
cmdApply.Enabled = True
End Sub
Private Sub Text1_KeyPress(KeyAscii As Integer)
If Chr(KeyAscii) Like "[!0-9.]" And (Not KeyAscii = 8) Then KeyAscii = 0
End Sub
Private Sub Text2_Change()
cmdApply.Enabled = True
End Sub
Private Sub Text2_KeyPress(KeyAscii As Integer)
If Chr(KeyAscii) Like "[!0-9.]" And (Not KeyAscii = 8) Then KeyAscii = 0
End Sub
Private Sub Text3_Change()
cmdApply.Enabled = True
End Sub
Private Sub Text3_KeyPress(KeyAscii As Integer)
If Chr(KeyAscii) Like "[!0-9.]" And (Not KeyAscii = 8) Then KeyAscii = 0
End Sub
Private Sub Text4_Change()
cmdApply.Enabled = True
End Sub
Private Sub Text4_KeyPress(KeyAscii As Integer)
If Chr(KeyAscii) Like "[!0-9.]" And (Not KeyAscii = 8) Then KeyAscii = 0
End Sub
Private Sub Text5_Change()
cmdApply.Enabled = True
End Sub
Private Sub Text5_KeyPress(KeyAscii As Integer)
If Chr(KeyAscii) Like "[!0-9.]" And (Not KeyAscii = 8) Then KeyAscii = 0
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -