?? frm_yh.frm
字號:
VERSION 5.00
Begin VB.Form frm_yh
Caption = "優惠"
ClientHeight = 3240
ClientLeft = 60
ClientTop = 345
ClientWidth = 4080
ControlBox = 0 'False
KeyPreview = -1 'True
LinkTopic = "Form1"
ScaleHeight = 3240
ScaleWidth = 4080
StartUpPosition = 1 '所有者中心
Begin VB.CommandButton Command2
Cancel = -1 'True
Caption = "取消[&C]"
BeginProperty Font
Name = "宋體"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 390
Left = 2655
TabIndex = 6
Top = 2685
Width = 945
End
Begin VB.CommandButton Command1
Caption = "確定[&S]"
Default = -1 'True
BeginProperty Font
Name = "宋體"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 390
Left = 1500
TabIndex = 5
Top = 2685
Width = 945
End
Begin VB.Frame Frame1
Height = 2475
Left = 270
TabIndex = 1
Top = 135
Width = 3540
Begin VB.TextBox txt_je
BeginProperty Font
Name = "宋體"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 360
Left = 2115
TabIndex = 0
Text = "Text2"
Top = 1395
Width = 945
End
Begin VB.TextBox txt_dz
BeginProperty Font
Name = "宋體"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 360
Left = 2115
TabIndex = 4
Text = "Text1"
Top = 1935
Width = 690
End
Begin VB.OptionButton Option2
Caption = "[F2]按折扣優惠"
BeginProperty Font
Name = "宋體"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 480
Left = 210
TabIndex = 3
Top = 1875
Width = 1860
End
Begin VB.OptionButton Option1
Caption = "[F1]按金額優惠"
BeginProperty Font
Name = "宋體"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 480
Left = 180
TabIndex = 2
Top = 1365
Value = -1 'True
Width = 1905
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "總額:"
BeginProperty Font
Name = "宋體"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 240
Index = 2
Left = 540
TabIndex = 11
Top = 375
Width = 720
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "余額:"
BeginProperty Font
Name = "宋體"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 240
Index = 1
Left = 540
TabIndex = 10
Top = 855
Width = 720
End
Begin VB.Label lab_total
BorderStyle = 1 'Fixed Single
Caption = "Label2"
BeginProperty Font
Name = "宋體"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FF0000&
Height = 375
Left = 1320
TabIndex = 9
Top = 330
Width = 960
End
Begin VB.Label lab_ye
BorderStyle = 1 'Fixed Single
Caption = "Label2"
BeginProperty Font
Name = "宋體"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FF0000&
Height = 375
Left = 1320
TabIndex = 8
Top = 825
Width = 960
End
Begin VB.Label Label1
Caption = "%"
BeginProperty Font
Name = "宋體"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 285
Index = 0
Left = 2865
TabIndex = 7
Top = 1965
Width = 225
End
End
End
Attribute VB_Name = "frm_yh"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
If Option1.Value = True Then
If Val(Me.txt_je) > Val(Me.lab_ye) Then
MsgBox "優惠金額超過余額!", vbExclamation, "警告"
Me.txt_je.SetFocus
SendKeys "{Home}+{End}"
Exit Sub
End If
frm_account.lab_ye = Format(Val(frm_account.lab_ye) - Val(txt_je.text), "0.0")
frm_account.Text1(0).text = Format(Val(frm_account.Text1(0).text) + Val(Trim(txt_je.text)), "0.0")
Else
frm_account.lab_ye = Format(Val(frm_account.lab_ye) - Val(Trim(txt_dz.text)) / 100 * Val(lab_ye.Caption), "0.0")
frm_account.Text1(0).text = Format(Val(frm_account.Text1(0).text) + Val(Trim(txt_dz.text)) / 100 * Val(lab_ye.Caption), "0.0")
End If
Unload Me
End Sub
Private Sub Command2_Click()
frm_account.Check2(n).Value = 0
Unload Me
End Sub
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
Select Case KeyCode
Case 112
Option1.Value = True
Option1_Click
Case 113
Option2.Value = True
Option2_Click
End Select
End Sub
Private Sub Form_Load()
txt_dz.text = "100"
txt_je.text = frm_account.lab_ye
'Option1.Value = True
txt_dz.Enabled = False
lab_total.Caption = frm_account.lab_total
lab_ye.Caption = frm_account.lab_ye
SendKeys "{Home}+{End}"
End Sub
Private Sub Option1_Click()
txt_dz.Enabled = False
txt_je.Enabled = True
txt_je.SetFocus
SendKeys "{Home}+{End}"
End Sub
Private Sub Option2_Click()
txt_dz.Enabled = True
txt_dz.SetFocus
SendKeys "{Home}+{End}"
txt_je.Enabled = False
End Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -