📄 dlgservice.frm
字号:
VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
Begin VB.Form dlgService
BorderStyle = 1 'Fixed Single
Caption = "选择客户服务类型"
ClientHeight = 3225
ClientLeft = 45
ClientTop = 330
ClientWidth = 3030
Icon = "dlgService.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 3225
ScaleWidth = 3030
StartUpPosition = 2 '屏幕中心
Begin VB.TextBox txtCustCode
Enabled = 0 'False
Height = 270
Left = 1080
MaxLength = 4
TabIndex = 0
Top = 240
Width = 1815
End
Begin VB.CommandButton cmdCancel
Cancel = -1 'True
Caption = "取消(&C)"
Height = 375
Left = 1920
TabIndex = 3
Top = 2760
Width = 975
End
Begin MSComctlLib.ListView lsvService
Height = 1815
Left = 120
TabIndex = 1
Top = 840
Width = 2775
_ExtentX = 4895
_ExtentY = 3201
View = 3
LabelEdit = 1
LabelWrap = 0 'False
HideSelection = 0 'False
FullRowSelect = -1 'True
GridLines = -1 'True
_Version = 393217
ForeColor = -2147483640
BackColor = -2147483643
Appearance = 1
NumItems = 2
BeginProperty ColumnHeader(1) {BDD1F052-858B-11D1-B16A-00C0F0283628}
Text = "编号"
Object.Width = 1270
EndProperty
BeginProperty ColumnHeader(2) {BDD1F052-858B-11D1-B16A-00C0F0283628}
Alignment = 2
SubItemIndex = 1
Text = "服务类型"
Object.Width = 2540
EndProperty
End
Begin VB.CommandButton cmdOK
Caption = "确定(&O)"
Height = 375
Left = 960
TabIndex = 2
Top = 2760
Width = 975
End
Begin VB.Label lblInfo
Caption = "客户编号:"
Height = 165
Index = 2
Left = 120
TabIndex = 4
Top = 300
Width = 975
End
Begin VB.Label lblInfo
Caption = "服务类型:"
Height = 165
Index = 1
Left = 120
TabIndex = 5
Top = 600
Width = 975
End
End
Attribute VB_Name = "dlgService"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim m_iItemID As Integer
Dim m_bService As Boolean
Dim m_sService As String
Dim m_sCustCode As String
Dim m_sCuID As String
Dim m_bCode As Boolean '传入标示
Private Sub cmdCancel_Click()
On Error Resume Next
m_bService = False
m_sService = ""
Unload Me
End Sub
Private Sub cmdOK_Click()
On Error Resume Next
If m_iItemID < 0 Then
MsgBox "请选择正确的服务类型!", vbOKOnly, "系统提示"
Exit Sub
End If
If Not IsNumeric(txtCustCode.Text) Then
MsgBox "请选择正确的客户编号!", vbOKOnly, "系统提示"
Exit Sub
End If
m_sCustCode = txtCustCode.Text
m_bService = True
m_sService = CStr(queue_service(m_iItemID).service_id)
Unload Me
End Sub
Private Sub Form_Load()
On Error Resume Next
Dim i As Integer
Dim itmX As ListItem
m_bService = False
m_sService = ""
m_sCustCode = ""
m_iItemID = 0
m_sCuID = ""
m_bCode = False
cmdOK.Enabled = False
For i = 0 To UBound(queue_service)
If queue_service(i).service_use = False Then
Set itmX = lsvService.ListItems.Add(, , i + 1)
itmX.SubItems(1) = queue_service(i).service_name
End If
Next i
End Sub
Private Sub Form_Terminate()
On Error Resume Next
Set dlgService = Nothing
End Sub
Private Sub lsvService_ItemClick(ByVal Item As MSComctlLib.ListItem)
On Error Resume Next
m_iItemID = CInt(Item.Text) - 1
cmdOK.Enabled = True
End Sub
Private Sub txtCustCode_GotFocus()
On Error Resume Next
txtCustCode.BackColor = &H80000018
End Sub
Private Sub txtCustCode_KeyPress(KeyAscii As Integer)
On Error Resume Next
If KeyAscii = 13 Then '是回车键?
KeyAscii = 0 '0取消输入
SendKeys "{tab}"
End If
End Sub
Private Sub txtCustCode_LostFocus()
On Error Resume Next
txtCustCode.BackColor = &H80000005
End Sub
'//////////////////////////////////////////////////////////////////////////////////////////
'/设定客户编号
Public Property Let CustCodeText(ByVal vNewValue As String)
On Error Resume Next
m_sCuID = vNewValue
m_bCode = True
End Property
'初始化对话框
Public Function InitSet(Optional ByVal bMode As Boolean = True) As Boolean
On Error GoTo ERROR_EXIT
If IsNumeric(m_sCuID) And m_bCode = True Then
txtCustCode.Text = m_sCuID
InitSet = True
Else
InitSet = False
End If
Exit Function
ERROR_EXIT:
InitSet = False
End Function
'/////////////////////////////////////////////////////////////////////////////////////////
'得到选择的编号
Public Property Get ServiceCode() As String
On Error Resume Next
ServiceCode = m_sService
End Property
'得到选择的状态
Public Property Get ServiceStatus() As Boolean
On Error Resume Next
ServiceStatus = m_bService
End Property
'得到客户编号结果
Public Property Get CustCode() As String
On Error Resume Next
CustCode = m_sCustCode
End Property
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -