?? 電話訂餐.frm
字號:
VERSION 5.00
Object = "{0D452EE1-E08F-101A-852E-02608C4D0BB4}#2.0#0"; "FM20.DLL"
Object = "{86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCT2.OCX"
Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "COMDLG32.OCX"
Begin VB.Form Form1
BorderStyle = 1 'Fixed Single
ClientHeight = 7620
ClientLeft = 45
ClientTop = 360
ClientWidth = 9465
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 7620
ScaleWidth = 9465
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton tc
Caption = "退出"
BeginProperty Font
Name = "宋體"
Size = 21.75
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 615
Left = 8040
TabIndex = 23
TabStop = 0 'False
Top = 6840
Width = 1215
End
Begin VB.Timer Timer1
Interval = 1000
Left = 5280
Top = 7200
End
Begin MSComDlg.CommonDialog CommonDialog1
Left = 5640
Top = 7200
_ExtentX = 847
_ExtentY = 847
_Version = 393216
End
Begin VB.CommandButton jsdy
Caption = "結(jié)算打印"
BeginProperty Font
Name = "宋體"
Size = 26.25
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 1095
Left = 3480
TabIndex = 21
TabStop = 0 'False
Top = 6360
Width = 1215
End
Begin VB.TextBox cdtxt
BackColor = &H00C0FFC0&
Height = 6495
Left = 5040
Locked = -1 'True
MultiLine = -1 'True
ScrollBars = 2 'Vertical
TabIndex = 20
TabStop = 0 'False
Top = 240
Width = 4215
End
Begin VB.TextBox zjtxt
BackColor = &H00C0FFFF&
Height = 495
Left = 6120
Locked = -1 'True
TabIndex = 19
TabStop = 0 'False
Top = 6840
Width = 1695
End
Begin VB.Frame Frame2
Caption = "輸入菜單"
Height = 2895
Left = 240
TabIndex = 11
Top = 2040
Width = 4575
Begin VB.CommandButton tj
Caption = "添加"
Enabled = 0 'False
BeginProperty Font
Name = "宋體"
Size = 42
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 1815
Left = 3240
TabIndex = 7
Top = 960
Width = 1215
End
Begin VB.TextBox djtxt
BackColor = &H00C0FFFF&
Height = 495
Left = 960
Locked = -1 'True
TabIndex = 17
TabStop = 0 'False
Top = 2280
Width = 2055
End
Begin VB.TextBox ywmtxt
BackColor = &H00C0FFFF&
Height = 495
Left = 120
Locked = -1 'True
TabIndex = 16
TabStop = 0 'False
Top = 1560
Width = 3015
End
Begin VB.TextBox zwmtxt
BackColor = &H00C0FFFF&
Height = 495
Left = 120
Locked = -1 'True
TabIndex = 15
TabStop = 0 'False
Top = 960
Width = 3015
End
Begin VB.TextBox bhtxt
BackColor = &H00C0FFFF&
Enabled = 0 'False
Height = 495
Left = 600
MaxLength = 3
TabIndex = 5
Top = 240
Width = 1455
End
Begin MSComCtl2.UpDown UpDown1
Height = 495
Left = 4246
TabIndex = 12
Top = 240
Width = 225
_ExtentX = 397
_ExtentY = 873
_Version = 393216
Value = 1
AutoBuddy = -1 'True
BuddyControl = "fstxt"
BuddyDispid = 196620
OrigLeft = 1920
OrigTop = 240
OrigRight = 2145
OrigBottom = 735
Max = 2000
Min = 1
SyncBuddy = -1 'True
BuddyProperty = 0
Enabled = -1 'True
End
Begin VB.TextBox fstxt
Alignment = 2 'Center
BackColor = &H00C0C0FF&
BeginProperty Font
Name = "宋體"
Size = 14.25
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 3120
TabIndex = 6
Text = "1"
Top = 240
Width = 1125
End
Begin VB.Label Label7
Caption = "單價:"
Height = 255
Left = 240
TabIndex = 22
Top = 2400
Width = 615
End
Begin MSForms.Label Label5
Height = 255
Left = 2520
TabIndex = 14
Top = 360
Width = 615
Caption = "份數(shù)"
Size = "1085;450"
FontName = "宋體"
FontHeight = 180
FontCharSet = 134
FontPitchAndFamily= 34
End
Begin MSForms.Label Label4
Height = 255
Left = 120
TabIndex = 13
Top = 360
Width = 615
Caption = "編號"
Size = "1085;450"
FontName = "宋體"
FontHeight = 180
FontCharSet = 134
FontPitchAndFamily= 34
End
End
Begin VB.Frame Frame1
Caption = "客戶信息"
Height = 1815
Left = 240
TabIndex = 0
Top = 120
Width = 4575
Begin VB.CommandButton ksdd
BackColor = &H8000000A&
Caption = "開始訂單"
Enabled = 0 'False
BeginProperty Font
Name = "宋體"
Size = 14.25
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 1335
Left = 3840
TabIndex = 4
Top = 240
Width = 615
End
Begin VB.TextBox dztxt
BackColor = &H00FFFFC0&
Height = 375
Left = 600
TabIndex = 3
Top = 1200
Width = 3135
End
Begin VB.TextBox dhtxt
BackColor = &H00FFFFC0&
Height = 375
Left = 600
TabIndex = 2
Top = 720
Width = 3135
End
Begin VB.TextBox xmtxt
BackColor = &H00FFFFC0&
Height = 375
Left = 600
TabIndex = 1
Top = 240
Width = 3135
End
Begin VB.Label Label3
Caption = "地址"
Height = 255
Left = 120
TabIndex = 10
Top = 1320
Width = 855
End
Begin VB.Label Label2
Caption = "電話"
Height = 255
Left = 120
TabIndex = 9
Top = 840
Width = 855
End
Begin VB.Label Label1
Caption = "姓名"
Height = 255
Left = 120
TabIndex = 8
Top = 360
Width = 855
End
End
Begin VB.Label Label6
Caption = "總價錢"
Height = 375
Left = 5280
TabIndex = 18
Top = 6960
Width = 735
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub bhtxt_Change()
'---------------嘗試----------
Dim textline
Dim curline As String
Dim Num As String
Dim name As String
Dim xyh(1)
'Open App.Path & "\" & "菜單.txt" For Input As #3
Open "f:\郭挺圳\vb\菜單.txt" For Input As #3
'*************************************************
While Not EOF(3)
On Error Resume Next
Line Input #3, curline
If Left(curline, 3) = bhtxt.Text - 1 Then
Input #3, Num, name, xyh(0), xyh(1)
zwmtxt.Text = name
ywmtxt.Text = xyh(0)
djtxt.Text = xyh(1)
End If
Wend
Close #3 ' 關(guān)閉文件。
'***************************************************
End Sub
Private Sub jsdy_Click()
'在下面添加打印內(nèi)容 訂餐姓名等 加上 cd.txt內(nèi)容 加上 總價
CommonDialog1.Flags = DefaultFlags
CommonDialog1.ShowPrinter
Printer.Copies = CommonDialog1.Copies
If cdtxt.SelText = "" Then
Printer.Print cdtxt.Text & vbCrLf & " --------------------------------------" & vbCrLf & " 總價(Total) " & zjtxt.Text
Else
End If
'**************************************************************
xmtxt.Text = ""
dhtxt.Text = ""
dztxt.Text = ""
cdtxt.Text = ""
zjtxt.Text = ""
xmtxt.Enabled = True
dhtxt.Enabled = True
dztxt.Enabled = True
End Sub
Private Sub ksdd_Click()
'*****************訂單號增加*****************
Dim n
n = n + 1
cdtxt.Text = " 訂單號:" & Date & "00" & n & vbCrLf
'*****************添加客戶信息到發(fā)票*********
cdtxt.Text = cdtxt.Text & " " & "姓名(Name) " & xmtxt.Text & vbCrLf & " " & "電話(Phone) " & dhtxt.Text & vbCrLf & " " & "地址(Address) " & dztxt.Text & vbCrLf & " --------------------------------------" & vbCrLf
'****************把客戶信息變?yōu)椴豢删庉?************
xmtxt.Enabled = False
dhtxt.Enabled = False
dztxt.Enabled = False
bhtxt.Enabled = True
ksdd.Enabled = False
xmtxt.TabStop = False '不能停留
dhtxt.TabStop = False
dztxt.TabStop = False
ksdd.TabStop = False
End Sub
Private Sub tc_Click()
Dim Msg, Style, Title, Help, Ctxt, Response, MyString
Msg = "確定要退出訂餐系統(tǒng)?" ' 定義信息。
Style = vbYesNo + vbQuestion + vbDefaultButton2 ' 定義按鈕。
Title = "注意" ' 定義標(biāo)題。
Response = MsgBox(Msg, Style, Title)
If Response = vbYes Then ' 用戶按下“是”。
End
Else ' 用戶按下“否”。
End If
End Sub
Private Sub Timer1_Timer()
Form1.Caption = "電話訂餐系統(tǒng)" & " " & Time
End Sub
Private Sub tj_Click()
cdtxt.Text = cdtxt.Text & " " & ywmtxt.Text & vbCrLf & " " & zwmtxt.Text & " " & djtxt.Text & " × " & fstxt.Text & vbCrLf & " ----------------------------" & vbCrLf
zjtxt.Text = Val(zjtxt.Text) + Val(djtxt.Text) * Val(fstxt.Text)
'******輸入防錯設(shè)計********
bhtxt.Text = ""
zwmtxt.Text = ""
ywmtxt.Text = ""
djtxt.Text = ""
fstxt.Text = 1
tj.Enabled = False
'**************************
End Sub
Private Sub xmtxt_Change()
If xmtxt.Text <> "" Then
ksdd.Enabled = True
End If
End Sub
Private Sub zwmtxt_Change()
If (zwmtxt.Text <> "") Then
tj.Enabled = True
End If
End Sub
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -