📄 form_xtshzh.frm
字号:
VERSION 5.00
Begin VB.Form Form_xtshzh
BorderStyle = 1 'Fixed Single
Caption = "系统设置"
ClientHeight = 2310
ClientLeft = 45
ClientTop = 375
ClientWidth = 6450
Icon = "Form_xtshzh.frx":0000
LinkTopic = "Form4"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 2310
ScaleWidth = 6450
StartUpPosition = 2 '屏幕中心
Begin VB.TextBox Text1
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 360
Left = 2520
TabIndex = 5
Top = 480
Width = 1335
End
Begin VB.CommandButton Command3
Caption = "确 定"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 360
Left = 2520
TabIndex = 2
Top = 1620
Width = 1335
End
Begin VB.CommandButton Command4
Caption = "退 出"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 360
Left = 4320
TabIndex = 1
Top = 1620
Width = 1335
End
Begin VB.TextBox Text2
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 360
Left = 2520
TabIndex = 0
Top = 1020
Width = 1335
End
Begin VB.Label Label2
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "串口设置"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00000000&
Height = 240
Left = 1320
TabIndex = 6
Top = 600
Width = 960
End
Begin VB.Label Label1
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "元"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00000000&
Height = 240
Left = 3960
TabIndex = 4
Top = 1140
Width = 240
End
Begin VB.Label Label3
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "自动刷卡金额"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00000000&
Height = 240
Left = 840
TabIndex = 3
Top = 1140
Width = 1440
End
End
Attribute VB_Name = "Form_xtshzh"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim lianjie As New Connection
Dim R_xtshzh As Recordset
Private Sub Command3_Click()
If Trim(Text2.Text) <> "" Then
R_xtshzh.Fields("串口设置") = CDbl(Text1.Text)
R_xtshzh.Fields("刷卡金额") = CDbl(Text2.Text)
R_xtshzh.Update
com_x = R_xtshzh.Fields("串口设置")
jine = R_xtshzh.Fields("刷卡金额")
MsgBox "设置成功!", vbInformation, "提示"
Unload Me
Else
Text2.SetFocus
End If
End Sub
Private Sub Command4_Click()
Unload Me
End Sub
Private Sub Form_Load()
With lianjie
.ConnectionString = dblianjie
.Open
End With
Set R_xtshzh = New Recordset
R_xtshzh.CursorLocation = adUseClient
R_xtshzh.CursorType = adOpenDynamic
R_xtshzh.LockType = adLockOptimistic
R_xtshzh.Open "select * from 设置 ", lianjie
If R_xtshzh.RecordCount > 0 Then
Text1.Text = R_xtshzh.Fields("串口设置")
Text2.Text = R_xtshzh.Fields("刷卡金额")
End If
End Sub
Private Sub Form_Unload(Cancel As Integer)
lianjie.Close
End Sub
Private Sub Text1_KeyPress(KeyAscii As Integer)
If Not (Chr(KeyAscii) Like "[0-9]" Or KeyAscii = vbKeyBack Or KeyAscii = 13) Then
KeyAscii = 0
End If
End Sub
Private Sub Text2_KeyPress(KeyAscii As Integer)
If Not (Chr(KeyAscii) Like "[0-9]" Or Chr(KeyAscii) = "." Or KeyAscii = vbKeyBack Or KeyAscii = 13) Then
KeyAscii = 0
End If
If KeyAscii = 13 And Text2.Text <> "" Then
Command3.SetFocus
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -