?? vbterm.frm
字號:
VERSION 5.00
Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "COMDLG32.OCX"
Object = "{3B7C8863-D78F-101B-B9B5-04021C009402}#1.2#0"; "RICHTX32.OCX"
Object = "{648A5603-2C6E-101B-82B6-000000000014}#1.1#0"; "MSCOMM32.OCX"
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
Begin VB.Form frmTerminal
ClientHeight = 4440
ClientLeft = 2940
ClientTop = 2055
ClientWidth = 6105
ForeColor = &H00000000&
Icon = "vbterm.frx":0000
LinkMode = 1 'Source
LinkTopic = "Form1"
ScaleHeight = 4440
ScaleWidth = 6105
StartUpPosition = 2 '屏幕中心
WindowState = 2 'Maximized
Begin MSComctlLib.ImageList ImageList1
Left = 240
Top = 2760
_ExtentX = 1005
_ExtentY = 1005
BackColor = -2147483643
ImageWidth = 16
ImageHeight = 16
MaskColor = 12632256
_Version = 393216
BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628}
NumListImages = 6
BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "vbterm.frx":27A2
Key = ""
EndProperty
BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "vbterm.frx":28B6
Key = ""
EndProperty
BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "vbterm.frx":29CA
Key = ""
EndProperty
BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "vbterm.frx":2ADE
Key = ""
EndProperty
BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "vbterm.frx":2F32
Key = ""
EndProperty
BeginProperty ListImage6 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "vbterm.frx":3386
Key = ""
EndProperty
EndProperty
End
Begin MSComctlLib.StatusBar sbrStatus
Align = 2 'Align Bottom
Height = 255
Left = 0
TabIndex = 1
Top = 4185
Width = 6105
_ExtentX = 10769
_ExtentY = 450
_Version = 393216
BeginProperty Panels {8E3867A5-8586-11D1-B16A-00C0F0283628}
NumPanels = 3
BeginProperty Panel1 {8E3867AB-8586-11D1-B16A-00C0F0283628}
Text = "狀態:"
TextSave = "狀態:"
Key = "Status"
Object.ToolTipText = "狀態:"
EndProperty
BeginProperty Panel2 {8E3867AB-8586-11D1-B16A-00C0F0283628}
AutoSize = 1
Object.Width = 5106
Key = "Settings"
Object.ToolTipText = "端口設置"
EndProperty
BeginProperty Panel3 {8E3867AB-8586-11D1-B16A-00C0F0283628}
Key = "ConnectTime"
Object.ToolTipText = "通訊時間"
EndProperty
EndProperty
End
Begin RichTextLib.RichTextBox RichTextBox1
Height = 3495
Left = 1680
TabIndex = 0
Top = 600
Width = 4215
_ExtentX = 7435
_ExtentY = 6165
_Version = 393217
BackColor = 16777215
ScrollBars = 3
DisableNoScroll = -1 'True
TextRTF = $"vbterm.frx":5B3A
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋體"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
End
Begin VB.Timer Timer2
Enabled = 0 'False
Interval = 2000
Left = 210
Top = 3645
End
Begin VB.Timer Timer1
Enabled = 0 'False
Interval = 1000
Left = 165
Top = 1815
End
Begin MSCommLib.MSComm MSComm1
Left = 45
Top = 510
_ExtentX = 1005
_ExtentY = 1005
_Version = 393216
DTREnable = -1 'True
InBufferSize = 31000
RThreshold = 1
RTSEnable = -1 'True
SThreshold = 1
EOFEnable = -1 'True
InputMode = 1
End
Begin MSComDlg.CommonDialog OpenLog
Left = 105
Top = 1170
_ExtentX = 847
_ExtentY = 847
_Version = 393216
DefaultExt = "LOG"
FileName = "Open Communications Log File"
Filter = "Log File (*.log)|*.log;"
FilterIndex = 501
FontSize = 0
MaxFileSize = 9000
End
Begin MSComctlLib.Toolbar tbrToolBar
Height = 390
Left = 0
Negotiate = -1 'True
TabIndex = 2
Top = 0
Width = 5205
_ExtentX = 9181
_ExtentY = 688
ButtonWidth = 609
ButtonHeight = 582
ImageList = "ImageList1"
DisabledImageList= "ImageList1"
HotImageList = "ImageList1"
_Version = 393216
BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628}
NumButtons = 12
BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628}
Style = 3
EndProperty
BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628}
Key = "tool打開"
Object.ToolTipText = "打開定位文件"
ImageIndex = 1
EndProperty
BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628}
Style = 3
EndProperty
BeginProperty Button4 {66833FEA-8583-11D1-B16A-00C0F0283628}
Key = "tool關閉"
Object.ToolTipText = "關閉定位文件"
ImageIndex = 4
EndProperty
BeginProperty Button5 {66833FEA-8583-11D1-B16A-00C0F0283628}
Style = 3
EndProperty
BeginProperty Button6 {66833FEA-8583-11D1-B16A-00C0F0283628}
Key = "tool端口設置"
Object.ToolTipText = "端口設置"
ImageIndex = 3
EndProperty
BeginProperty Button7 {66833FEA-8583-11D1-B16A-00C0F0283628}
Style = 3
EndProperty
BeginProperty Button8 {66833FEA-8583-11D1-B16A-00C0F0283628}
Key = "tool數據"
Object.ToolTipText = "數據傳輸"
ImageIndex = 5
EndProperty
BeginProperty Button9 {66833FEA-8583-11D1-B16A-00C0F0283628}
Style = 3
EndProperty
BeginProperty Button10 {66833FEA-8583-11D1-B16A-00C0F0283628}
Key = "tool保存"
Object.ToolTipText = "保存文件"
ImageIndex = 2
EndProperty
BeginProperty Button11 {66833FEA-8583-11D1-B16A-00C0F0283628}
Style = 3
EndProperty
BeginProperty Button12 {66833FEA-8583-11D1-B16A-00C0F0283628}
Key = "tool關于"
Object.ToolTipText = "關于....."
ImageIndex = 6
EndProperty
EndProperty
Begin VB.Image Image1
BorderStyle = 1 'Fixed Single
Height = 255
Left = 7440
Stretch = -1 'True
Top = 2000
Width = 735
End
End
Begin VB.Image imgNotConnected
Height = 240
Left = 5760
Picture = "vbterm.frx":5D74
Stretch = -1 'True
ToolTipText = "端口關"
Top = 0
Width = 240
End
Begin VB.Image imgConnected
Height = 240
Left = 5760
Picture = "vbterm.frx":5EBE
Stretch = -1 'True
ToolTipText = "端口開"
Top = 0
Width = 240
End
Begin VB.Menu mnuFile
Caption = "文件(&F)"
Begin VB.Menu mnuOpenLog
Caption = "打開定位文件(&O)"
End
Begin VB.Menu mnuCloseLog
Caption = "關閉定位文件(&C)"
Enabled = 0 'False
End
Begin VB.Menu M3
Caption = "-"
End
Begin VB.Menu mnuFileExit
Caption = "退出(&E)"
Shortcut = ^Q
End
End
Begin VB.Menu mnuPort
Caption = "端口(&C)"
Begin VB.Menu mnuOpen
Caption = "打開端口(&O)"
End
Begin VB.Menu MBar1
Caption = "-"
End
Begin VB.Menu mnuProperties
Caption = "端口設置(&S)"
End
End
Begin VB.Menu mnuMSComm
Caption = "數據接收(&M)"
Begin VB.Menu mnuInputLen
Caption = "接收數據(&I)"
End
Begin VB.Menu Bar3
Caption = "-"
End
Begin VB.Menu MUNSAVE
Caption = "保存 (&S)"
End
Begin VB.Menu KKKK
Caption = "-"
End
Begin VB.Menu MUNKILL
Caption = "清除 (&K)"
End
End
Begin VB.Menu MUN幫助
Caption = "幫助(&H)"
Begin VB.Menu mun主題
Caption = "主題(&C)"
Shortcut = {F1}
End
Begin VB.Menu mun索引
Caption = "索引(&I)..."
End
Begin VB.Menu mx
Caption = "-"
End
Begin VB.Menu MUN關于
Caption = "關于(&A)..."
End
End
End
Attribute VB_Name = "frmTerminal"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim Ret As Integer ' Scratch integer.
Dim Temp As String ' Scratch string.
Dim hLogFile As Integer ' Handle of open log file.
Dim StartTime As Date ' Stores starting time for port timer
Private Sub Form_Load()
Dim CommPort As String, Handshaking As String, Settings As String
On Error Resume Next
' Set the default color for the terminal
RichTextBox1.SelLength = Len(RichTextBox1)
RichTextBox1.SelText = ""
' RichTextBox1.ForeColor = vbBlue
' Set Title
App.Title = "儀器通訊程序"
' Set up status indicator light
imgNotConnected.ZOrder
' Center Form
frmTerminal.Move (Screen.Width - Width) / 2, (Screen.Height - Height) / 2
' Load Registry Settings
Settings = GetSetting(App.Title, "端口設置", "傳輸屬性", "") ' frmTerminal.MSComm1.Settings]\
If Settings <> "" Then
MSComm1.Settings = Settings
If Err Then
MsgBox Error$, 48
Exit Sub
End If
End If
CommPort = GetSetting(App.Title, "端口設置", "通訊端口號", "") ' frmTerminal.MSComm1.CommPort
If CommPort <> "" Then MSComm1.CommPort = CommPort
Handshaking = GetSetting(App.Title, "端口設置", "傳輸協議", "") 'frmTerminal.MSComm1.Handshaking
If Handshaking <> "" Then
MSComm1.Handshaking = Handshaking
If Err Then
MsgBox Error$, 48
Exit Sub
End If
End If
Echo = GetSetting(App.Title, "端口設置", "響應", "") ' Echo
On Error GoTo 0
End Sub
Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
Close
End Sub
Private Sub Form_Resize()
On Error Resume Next
' Resize the Term (display) control
RichTextBox1.Move 0, tbrToolBar.Height, frmTerminal.ScaleWidth, frmTerminal.ScaleHeight - sbrStatus.Height - tbrToolBar.Height
'Position the status indicator light
'Frame1.Left = ScaleWidth - Frame1.Width * 1.5
End Sub
Private Sub Form_Unload(Cancel As Integer)
Dim Counter As Long
If MSComm1.PortOpen Then
' Wait 10 seconds for data to be transmitted.
Counter = Timer + 10
Do While MSComm1.OutBufferCount
Ret = DoEvents()
If Timer > Counter Then
Select Case MsgBox("Data cannot be sent", 34)
' Cancel.
Case 3
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -