?? frmsupplier.frm
字號(hào):
VERSION 5.00
Begin VB.Form frmSupplier
BorderStyle = 1 'Fixed Single
Caption = "供貨商管理"
ClientHeight = 3495
ClientLeft = 45
ClientTop = 330
ClientWidth = 6465
LinkTopic = "Form1"
LockControls = -1 'True
MaxButton = 0 'False
ScaleHeight = 3495
ScaleWidth = 6465
StartUpPosition = 1 '所有者中心
Begin VB.Frame FrameBG
Height = 3630
Left = 0
TabIndex = 6
Top = -135
Width = 6465
Begin VB.PictureBox picTitle
Appearance = 0 'Flat
BackColor = &H00808080&
BorderStyle = 0 'None
ForeColor = &H80000008&
Height = 360
Left = 30
ScaleHeight = 360
ScaleWidth = 6420
TabIndex = 7
TabStop = 0 'False
Top = 120
Width = 6420
Begin VB.Label lblTitle
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "登記供貨商"
BeginProperty Font
Name = "宋體"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FFFFFF&
Height = 210
Left = 255
TabIndex = 8
Top = 90
Width = 1125
End
End
Begin VB.TextBox txt
Height = 270
Index = 0
Left = 1410
MaxLength = 50
TabIndex = 0
Top = 750
Width = 4695
End
Begin VB.TextBox txt
Height = 270
Index = 1
Left = 1410
MaxLength = 500
TabIndex = 1
Top = 1110
Width = 4695
End
Begin VB.TextBox txt
Height = 270
Index = 2
Left = 1410
MaxLength = 500
TabIndex = 2
Top = 1470
Width = 4695
End
Begin VB.CommandButton cmdSupplier
Caption = "確定(&O)"
Height = 375
Left = 3525
TabIndex = 4
Top = 3045
Width = 1080
End
Begin VB.CommandButton cmdCancel
Cancel = -1 'True
Caption = "取消(&C)"
Height = 375
Left = 4875
TabIndex = 5
Top = 3045
Width = 1080
End
Begin VB.TextBox txt
Height = 990
Index = 3
Left = 1410
MaxLength = 500
MultiLine = -1 'True
ScrollBars = 2 'Vertical
TabIndex = 3
Top = 1830
Width = 4695
End
Begin VB.Label Label2
AutoSize = -1 'True
Caption = "供貨商名稱"
Height = 180
Left = 345
TabIndex = 12
Top = 795
Width = 900
End
Begin VB.Label Label3
AutoSize = -1 'True
Caption = "聯(lián)系方式"
Height = 180
Left = 345
TabIndex = 11
Top = 1170
Width = 720
End
Begin VB.Label Label4
AutoSize = -1 'True
Caption = "簡(jiǎn)要介紹"
Height = 180
Left = 345
TabIndex = 10
Top = 1530
Width = 720
End
Begin VB.Label Label6
AutoSize = -1 'True
Caption = "備注"
Height = 180
Left = 345
TabIndex = 9
Top = 1890
Width = 360
End
End
End
Attribute VB_Name = "frmSupplier"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim Supplier As clsSupplier '供貨商對(duì)象
Private Sub cmdSupplier_Click()
'必須填寫(xiě)供貨商名稱
If txt(0) = "" Then MsgBox "請(qǐng)?zhí)顚?xiě)完整!", vbInformation: Exit Sub
'初始化供貨商對(duì)象
Set Supplier = New clsSupplier
With Supplier
'為供貨商對(duì)象的屬性賦值
.SupplierName = Trim(txt(0))
.Contact = IIf(Trim(txt(1)) = "", "無(wú)", Trim(txt(1)))
.Introduce = IIf(Trim(txt(2)) = "", "無(wú)", Trim(txt(2)))
.Remark = IIf(Trim(txt(3)) = "", "無(wú)", RTrim(txt(3)))
'根據(jù)cmdSupplier的Caption屬性修改或添加供貨商對(duì)象
Select Case cmdSupplier.Caption
Case "修改(&M)": UpdateSupplier '修改供貨商對(duì)象
Case Else: AddNewSupplier '添加供貨商對(duì)象
End Select
End With
txt(0).SetFocus
End Sub
'更新供貨商對(duì)象
Private Sub UpdateSupplier()
Dim UpdateResult As gxcUpdate '更新結(jié)果
'指定供貨商對(duì)象的ID屬性
Supplier.ID = Me.Tag
'更新供貨商對(duì)象并返回更新結(jié)果
UpdateResult = Supplier.Update
'同步更新列表視圖并彈出提示消息框
ProcUpdateResult UpdateResult, Supplier
End Sub
'添加供貨商對(duì)象
Private Sub AddNewSupplier()
Dim AddNewResult As gxcAddNew '添加結(jié)果
'添加供貨商對(duì)象并返回添加結(jié)果
AddNewResult = Supplier.AddNew
'添加成功之后的操作
If AddNewResult = AddNewOK Then
txt(0) = "": txt(1) = "": txt(2) = "": txt(3) = ""
'當(dāng)前操作處于瀏覽供貨商信息狀態(tài),則在列表視圖上添加供貨商信息
If CurrentOperation = BrowseSupplier Then ShowObjInLvw Supplier
MsgBox "登記成功!", vbInformation
Exit Sub
End If
'添加失敗后的操作(消息框提示用戶)
ProcAddNewResult AddNewResult
End Sub
Private Sub cmdCancel_Click()
Unload Me
End Sub
'文本框獲得焦點(diǎn)時(shí)選中所有文字
Private Sub txt_GotFocus(Index As Integer)
txt(Index).SelStart = 0 '選中文字的起始位置
txt(Index).SelLength = Len(txt(Index)) '選中文字的長(zhǎng)度
End Sub
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -