?? frmset.frm
字號:
VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
Begin VB.Form frmSet
Caption = "登錄信息設置"
ClientHeight = 1830
ClientLeft = 60
ClientTop = 345
ClientWidth = 4110
LinkTopic = "Form1"
LockControls = -1 'True
MaxButton = 0 'False
ScaleHeight = 1830
ScaleWidth = 4110
StartUpPosition = 2 '屏幕中心
Begin VB.PictureBox Picture1
AutoRedraw = -1 'True
AutoSize = -1 'True
BackColor = &H80000016&
BorderStyle = 0 'None
Height = 240
Index = 4
Left = 120
Picture = "frmSet.frx":0000
ScaleHeight = 240
ScaleWidth = 240
TabIndex = 8
Top = 150
Width = 240
End
Begin VB.PictureBox Picture1
AutoRedraw = -1 'True
AutoSize = -1 'True
BackColor = &H80000016&
BorderStyle = 0 'None
Height = 240
Index = 2
Left = 120
Picture = "frmSet.frx":058A
ScaleHeight = 240
ScaleWidth = 240
TabIndex = 10
Top = 870
Width = 240
End
Begin VB.PictureBox Picture1
AutoRedraw = -1 'True
AutoSize = -1 'True
BackColor = &H80000016&
BorderStyle = 0 'None
Height = 240
Index = 1
Left = 120
Picture = "frmSet.frx":0914
ScaleHeight = 240
ScaleWidth = 240
TabIndex = 9
Top = 510
Width = 240
End
Begin VB.TextBox txtPort
BackColor = &H00FFFFFF&
Height = 300
IMEMode = 3 'DISABLE
Left = 1800
TabIndex = 2
Top = 840
Width = 2175
End
Begin VB.TextBox txtServer
BackColor = &H00FFFFFF&
Height = 300
IMEMode = 3 'DISABLE
Left = 1800
TabIndex = 0
Top = 120
Width = 2175
End
Begin VB.TextBox txtIPNumber
BackColor = &H00FFFFFF&
Enabled = 0 'False
Height = 300
IMEMode = 3 'DISABLE
Left = 1800
TabIndex = 1
Top = 480
Width = 2175
End
Begin VB.CommandButton cmdCancel
Cancel = -1 'True
Caption = "取消(&C)"
Height = 375
Left = 2880
TabIndex = 4
Top = 1320
Width = 1095
End
Begin VB.CommandButton cmdOK
Caption = "確定(&O)"
Height = 375
Left = 1800
TabIndex = 3
Top = 1320
Width = 1095
End
Begin MSComctlLib.StatusBar StatusBar1
Height = 300
Left = 480
TabIndex = 5
Top = 120
Width = 1215
_ExtentX = 2143
_ExtentY = 529
_Version = 393216
BeginProperty Panels {8E3867A5-8586-11D1-B16A-00C0F0283628}
NumPanels = 1
BeginProperty Panel1 {8E3867AB-8586-11D1-B16A-00C0F0283628}
Bevel = 2
Text = "數據服務器:"
TextSave = "數據服務器:"
EndProperty
EndProperty
End
Begin MSComctlLib.StatusBar StatusBar3
Height = 300
Left = 480
TabIndex = 7
Top = 840
Width = 1215
_ExtentX = 2143
_ExtentY = 529
_Version = 393216
BeginProperty Panels {8E3867A5-8586-11D1-B16A-00C0F0283628}
NumPanels = 1
BeginProperty Panel1 {8E3867AB-8586-11D1-B16A-00C0F0283628}
Bevel = 2
Text = "服務端口號:"
TextSave = "服務端口號:"
EndProperty
EndProperty
End
Begin MSComctlLib.StatusBar StatusBar4
Height = 300
Left = 480
TabIndex = 6
Top = 480
Width = 1215
_ExtentX = 2143
_ExtentY = 529
_Version = 393216
BeginProperty Panels {8E3867A5-8586-11D1-B16A-00C0F0283628}
NumPanels = 1
BeginProperty Panel1 {8E3867AB-8586-11D1-B16A-00C0F0283628}
Bevel = 2
Text = "服務器地址:"
TextSave = "服務器地址:"
EndProperty
EndProperty
End
End
Attribute VB_Name = "frmSet"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim m_tagErrInfo As TYPE_ERRORINFO ' 錯誤信息
Public m_sServerName As String
Public m_iServerPort As Integer
Public m_bCancel As Boolean
Private Sub cmdCancel_Click()
On Error Resume Next
m_sServerName = ""
m_iServerPort = 0
m_bCancel = True
Unload Me
End Sub
Private Sub cmdOK_Click()
On Error GoTo ERROR_EXIT
If Trim$(txtServer.Text) = "" Or IsNumeric(txtPort.Text) = False Then
MsgBox "請輸入有效的數據服務器名和服務端口號!", vbOKOnly + vbCritical, "系統錯誤"
txtServer.SetFocus
Exit Sub
Else
m_sServerName = Trim$(txtServer.Text)
m_iServerPort = CInt(txtPort.Text)
m_bCancel = False
Unload Me
End If
Exit Sub
ERROR_EXIT:
m_tagErrInfo.strErrDate = Format(Now, "yyyy-mm-dd hh:mm:ss")
m_tagErrInfo.strErrFile = "frmSet"
m_tagErrInfo.strErrFunc = "cmdOK_Click"
m_tagErrInfo.nErrNum = Err.Number
m_tagErrInfo.strErrDesc = Error(Err.Number)
If Err.Number <> 0 Then Err.Clear
modErrorInfo.WriteErrLog m_tagErrInfo
End Sub
Private Sub Form_Load()
On Error GoTo ERROR_EXIT
m_bCancel = False
txtServer.Text = m_strServer
txtIPNumber.Text = ""
txtPort.Text = m_iPort
Exit Sub
ERROR_EXIT:
m_tagErrInfo.strErrDate = Format(Now, "yyyy-mm-dd hh:mm:ss")
m_tagErrInfo.strErrFile = "frmSet"
m_tagErrInfo.strErrFunc = "Form_Load"
m_tagErrInfo.nErrNum = Err.Number
m_tagErrInfo.strErrDesc = Error(Err.Number)
If Err.Number <> 0 Then Err.Clear
modErrorInfo.WriteErrLog m_tagErrInfo
End Sub
Private Sub txtIPNumber_GotFocus()
On Error Resume Next
txtIPNumber.BackColor = &H80000018
End Sub
Private Sub txtIPNumber_KeyPress(KeyAscii As Integer)
On Error Resume Next
If KeyAscii = 13 Then '是回車鍵?
KeyAscii = 0 '0取消輸入
SendKeys "{tab}"
End If
End Sub
Private Sub txtIPNumber_LostFocus()
On Error Resume Next
txtIPNumber.BackColor = &H80000005
End Sub
Private Sub txtPort_GotFocus()
On Error Resume Next
txtPort.BackColor = &H80000018
End Sub
Private Sub txtPort_KeyPress(KeyAscii As Integer)
On Error Resume Next
If KeyAscii = 13 Then '是回車鍵?
KeyAscii = 0 '0取消輸入
SendKeys "{tab}"
End If
End Sub
Private Sub txtPort_LostFocus()
On Error Resume Next
Dim i As Integer
If IsNumeric(txtPort.Text) = False Then
txtPort.SetFocus
SendKeys "{HOME}", True
SendKeys "+{END}", True
Exit Sub
End If
If CInt(txtPort.Text) < 1 Then txtPort.Text = "1"
If CInt(txtPort.Text) > 65535 Then txtPort.Text = "65535"
txtPort.BackColor = &H80000005
End Sub
Private Sub txtServer_GotFocus()
On Error Resume Next
txtServer.BackColor = &H80000018
End Sub
Private Sub txtServer_KeyPress(KeyAscii As Integer)
On Error Resume Next
If KeyAscii = 13 Then '是回車鍵?
KeyAscii = 0 '0取消輸入
SendKeys "{tab}"
End If
End Sub
Private Sub txtServer_LostFocus()
On Error Resume Next
txtServer.BackColor = &H80000005
End Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -