⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 form1.vb

📁 VB开发的串口调试程序,VB开发的串口调试程序
💻 VB
📖 第 1 页 / 共 2 页
字号:
Option Strict Off
Option Explicit On
Imports VB = Microsoft.VisualBasic
Friend Class Form1
	Inherits System.Windows.Forms.Form
#Region "Windows 窗体设计器生成的代码"
	Public Sub New()
		MyBase.New()
		If m_vb6FormDefInstance Is Nothing Then
			If m_InitializingDefInstance Then
				m_vb6FormDefInstance = Me
			Else
				Try 
					'对于启动窗体,所创建的第一个实例为默认实例。
					If System.Reflection.Assembly.GetExecutingAssembly.EntryPoint.DeclaringType Is Me.GetType Then
						m_vb6FormDefInstance = Me
					End If
				Catch
				End Try
			End If
		End If
		'此调用是 Windows 窗体设计器所必需的。
		InitializeComponent()
	End Sub
	'窗体重写处置,以清理组件列表。
	Protected Overloads Overrides Sub Dispose(ByVal Disposing As Boolean)
		If Disposing Then
			If Not components Is Nothing Then
				components.Dispose()
			End If
		End If
		MyBase.Dispose(Disposing)
	End Sub
	'Windows 窗体设计器所必需的
	Private components As System.ComponentModel.IContainer
	Public ToolTip1 As System.Windows.Forms.ToolTip
	Public WithEvents MSComm1 As AxMSCommLib.AxMSComm
	Public WithEvents Command5 As System.Windows.Forms.Button
	Public WithEvents Combo5 As System.Windows.Forms.ComboBox
	Public WithEvents Combo4 As System.Windows.Forms.ComboBox
	Public WithEvents Combo3 As System.Windows.Forms.ComboBox
	Public WithEvents Combo2 As System.Windows.Forms.ComboBox
	Public WithEvents Combo1 As System.Windows.Forms.ComboBox
	Public WithEvents Command4 As System.Windows.Forms.Button
	Public WithEvents Text2 As System.Windows.Forms.TextBox
	Public WithEvents Command3 As System.Windows.Forms.Button
	Public WithEvents Text1 As System.Windows.Forms.TextBox
	Public WithEvents Command2 As System.Windows.Forms.Button
	Public WithEvents Command1 As System.Windows.Forms.Button
	Public WithEvents Label7 As System.Windows.Forms.Label
	Public WithEvents Label6 As System.Windows.Forms.Label
	Public WithEvents Shape1 As System.Windows.Forms.Label
	Public WithEvents Label5 As System.Windows.Forms.Label
	Public WithEvents Label4 As System.Windows.Forms.Label
	Public WithEvents Label3 As System.Windows.Forms.Label
	Public WithEvents Label2 As System.Windows.Forms.Label
	Public WithEvents Label1 As System.Windows.Forms.Label
	'注意: 以下过程是 Windows 窗体设计器所必需的
	'可以使用 Windows 窗体设计器来修改它。
	'不要使用代码编辑器修改它。
	<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
		Dim resources As System.Resources.ResourceManager = New System.Resources.ResourceManager(GetType(Form1))
		Me.components = New System.ComponentModel.Container()
		Me.ToolTip1 = New System.Windows.Forms.ToolTip(components)
		Me.ToolTip1.Active = True
		Me.MSComm1 = New AxMSCommLib.AxMSComm
		Me.Command5 = New System.Windows.Forms.Button
		Me.Combo5 = New System.Windows.Forms.ComboBox
		Me.Combo4 = New System.Windows.Forms.ComboBox
		Me.Combo3 = New System.Windows.Forms.ComboBox
		Me.Combo2 = New System.Windows.Forms.ComboBox
		Me.Combo1 = New System.Windows.Forms.ComboBox
		Me.Command4 = New System.Windows.Forms.Button
		Me.Text2 = New System.Windows.Forms.TextBox
		Me.Command3 = New System.Windows.Forms.Button
		Me.Text1 = New System.Windows.Forms.TextBox
		Me.Command2 = New System.Windows.Forms.Button
		Me.Command1 = New System.Windows.Forms.Button
		Me.Label7 = New System.Windows.Forms.Label
		Me.Label6 = New System.Windows.Forms.Label
		Me.Shape1 = New System.Windows.Forms.Label
		Me.Label5 = New System.Windows.Forms.Label
		Me.Label4 = New System.Windows.Forms.Label
		Me.Label3 = New System.Windows.Forms.Label
		Me.Label2 = New System.Windows.Forms.Label
		Me.Label1 = New System.Windows.Forms.Label
		CType(Me.MSComm1, System.ComponentModel.ISupportInitialize).BeginInit()
		Me.StartPosition = System.Windows.Forms.FormStartPosition.Manual
		Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle
		Me.Text = "串口调试工具 V1.0  http://Anykey.name"
		Me.ClientSize = New System.Drawing.Size(463, 322)
		Me.Location = New System.Drawing.Point(311, 245)
		Me.MaximizeBox = False
		Me.AutoScaleBaseSize = New System.Drawing.Size(6, 14)
		Me.BackColor = System.Drawing.SystemColors.Control
		Me.ControlBox = True
		Me.Enabled = True
		Me.KeyPreview = False
		Me.MinimizeBox = True
		Me.Cursor = System.Windows.Forms.Cursors.Default
		Me.RightToLeft = System.Windows.Forms.RightToLeft.No
		Me.ShowInTaskbar = True
		Me.HelpButton = False
		Me.WindowState = System.Windows.Forms.FormWindowState.Normal
		Me.Name = "Form1"
		MSComm1.OcxState = CType(resources.GetObject("MSComm1.OcxState"), System.Windows.Forms.AxHost.State)
		Me.MSComm1.Location = New System.Drawing.Point(136, 48)
		Me.MSComm1.Name = "MSComm1"
		Me.Command5.TextAlign = System.Drawing.ContentAlignment.MiddleCenter
		Me.Command5.Text = "清除发送区"
		Me.Command5.Size = New System.Drawing.Size(85, 25)
		Me.Command5.Location = New System.Drawing.Point(192, 56)
		Me.Command5.TabIndex = 18
		Me.Command5.BackColor = System.Drawing.SystemColors.Control
		Me.Command5.CausesValidation = True
		Me.Command5.Enabled = True
		Me.Command5.ForeColor = System.Drawing.SystemColors.ControlText
		Me.Command5.Cursor = System.Windows.Forms.Cursors.Default
		Me.Command5.RightToLeft = System.Windows.Forms.RightToLeft.No
		Me.Command5.TabStop = True
		Me.Command5.Name = "Command5"
		Me.Combo5.Size = New System.Drawing.Size(57, 20)
		Me.Combo5.Location = New System.Drawing.Point(308, 32)
		Me.Combo5.Items.AddRange(New Object(){"1", "2"})
		Me.Combo5.TabIndex = 15
		Me.Combo5.Text = "1"
		Me.Combo5.BackColor = System.Drawing.SystemColors.Window
		Me.Combo5.CausesValidation = True
		Me.Combo5.Enabled = True
		Me.Combo5.ForeColor = System.Drawing.SystemColors.WindowText
		Me.Combo5.IntegralHeight = True
		Me.Combo5.Cursor = System.Windows.Forms.Cursors.Default
		Me.Combo5.RightToLeft = System.Windows.Forms.RightToLeft.No
		Me.Combo5.Sorted = False
		Me.Combo5.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDown
		Me.Combo5.TabStop = True
		Me.Combo5.Visible = True
		Me.Combo5.Name = "Combo5"
		Me.Combo4.Size = New System.Drawing.Size(57, 20)
		Me.Combo4.Location = New System.Drawing.Point(232, 32)
		Me.Combo4.Items.AddRange(New Object(){"6", "7", "8"})
		Me.Combo4.TabIndex = 14
		Me.Combo4.Text = "8"
		Me.Combo4.BackColor = System.Drawing.SystemColors.Window
		Me.Combo4.CausesValidation = True
		Me.Combo4.Enabled = True
		Me.Combo4.ForeColor = System.Drawing.SystemColors.WindowText
		Me.Combo4.IntegralHeight = True
		Me.Combo4.Cursor = System.Windows.Forms.Cursors.Default
		Me.Combo4.RightToLeft = System.Windows.Forms.RightToLeft.No
		Me.Combo4.Sorted = False
		Me.Combo4.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDown
		Me.Combo4.TabStop = True
		Me.Combo4.Visible = True
		Me.Combo4.Name = "Combo4"
		Me.Combo3.Size = New System.Drawing.Size(57, 20)
		Me.Combo3.Location = New System.Drawing.Point(156, 32)
		Me.Combo3.Items.AddRange(New Object(){"E", "N", "O"})
		Me.Combo3.TabIndex = 13
		Me.Combo3.Text = "N"
		Me.Combo3.BackColor = System.Drawing.SystemColors.Window
		Me.Combo3.CausesValidation = True
		Me.Combo3.Enabled = True
		Me.Combo3.ForeColor = System.Drawing.SystemColors.WindowText
		Me.Combo3.IntegralHeight = True
		Me.Combo3.Cursor = System.Windows.Forms.Cursors.Default
		Me.Combo3.RightToLeft = System.Windows.Forms.RightToLeft.No
		Me.Combo3.Sorted = False
		Me.Combo3.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDown
		Me.Combo3.TabStop = True
		Me.Combo3.Visible = True
		Me.Combo3.Name = "Combo3"
		Me.Combo2.Size = New System.Drawing.Size(57, 20)
		Me.Combo2.Location = New System.Drawing.Point(80, 32)
		Me.Combo2.Items.AddRange(New Object(){"300", "600", "1200", "2400", "4800", "9600", "19200", "38400", "43000", "56000", "57600", "115200"})
		Me.Combo2.TabIndex = 12
		Me.Combo2.Text = "9600"
		Me.Combo2.BackColor = System.Drawing.SystemColors.Window
		Me.Combo2.CausesValidation = True
		Me.Combo2.Enabled = True
		Me.Combo2.ForeColor = System.Drawing.SystemColors.WindowText
		Me.Combo2.IntegralHeight = True
		Me.Combo2.Cursor = System.Windows.Forms.Cursors.Default
		Me.Combo2.RightToLeft = System.Windows.Forms.RightToLeft.No
		Me.Combo2.Sorted = False
		Me.Combo2.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDown
		Me.Combo2.TabStop = True
		Me.Combo2.Visible = True
		Me.Combo2.Name = "Combo2"
		Me.Combo1.Size = New System.Drawing.Size(57, 20)
		Me.Combo1.Location = New System.Drawing.Point(4, 32)
		Me.Combo1.Items.AddRange(New Object(){"COM1", "COM2", "COM3", "COM4"})
		Me.Combo1.TabIndex = 11
		Me.Combo1.Text = "COM1"
		Me.Combo1.BackColor = System.Drawing.SystemColors.Window
		Me.Combo1.CausesValidation = True
		Me.Combo1.Enabled = True
		Me.Combo1.ForeColor = System.Drawing.SystemColors.WindowText
		Me.Combo1.IntegralHeight = True
		Me.Combo1.Cursor = System.Windows.Forms.Cursors.Default
		Me.Combo1.RightToLeft = System.Windows.Forms.RightToLeft.No
		Me.Combo1.Sorted = False
		Me.Combo1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDown
		Me.Combo1.TabStop = True
		Me.Combo1.Visible = True
		Me.Combo1.Name = "Combo1"
		Me.Command4.TextAlign = System.Drawing.ContentAlignment.MiddleCenter
		Me.Command4.Text = "开启串口"
		Me.Command4.Size = New System.Drawing.Size(85, 25)
		Me.Command4.Location = New System.Drawing.Point(376, 28)
		Me.Command4.TabIndex = 5
		Me.Command4.BackColor = System.Drawing.SystemColors.Control
		Me.Command4.CausesValidation = True
		Me.Command4.Enabled = True
		Me.Command4.ForeColor = System.Drawing.SystemColors.ControlText
		Me.Command4.Cursor = System.Windows.Forms.Cursors.Default
		Me.Command4.RightToLeft = System.Windows.Forms.RightToLeft.No
		Me.Command4.TabStop = True
		Me.Command4.Name = "Command4"
		Me.Text2.AutoSize = False
		Me.Text2.Size = New System.Drawing.Size(373, 25)
		Me.Text2.Location = New System.Drawing.Point(0, 84)
		Me.Text2.TabIndex = 4
		Me.Text2.AcceptsReturn = True
		Me.Text2.TextAlign = System.Windows.Forms.HorizontalAlignment.Left
		Me.Text2.BackColor = System.Drawing.SystemColors.Window
		Me.Text2.CausesValidation = True
		Me.Text2.Enabled = True
		Me.Text2.ForeColor = System.Drawing.SystemColors.WindowText
		Me.Text2.HideSelection = True
		Me.Text2.ReadOnly = False
		Me.Text2.Maxlength = 0
		Me.Text2.Cursor = System.Windows.Forms.Cursors.IBeam
		Me.Text2.MultiLine = False
		Me.Text2.RightToLeft = System.Windows.Forms.RightToLeft.No
		Me.Text2.ScrollBars = System.Windows.Forms.ScrollBars.None
		Me.Text2.TabStop = True
		Me.Text2.Visible = True
		Me.Text2.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D
		Me.Text2.Name = "Text2"
		Me.Command3.TextAlign = System.Drawing.ContentAlignment.MiddleCenter
		Me.Command3.Text = "清除接收区"
		Me.Command3.Size = New System.Drawing.Size(85, 25)
		Me.Command3.Location = New System.Drawing.Point(284, 56)
		Me.Command3.TabIndex = 3
		Me.Command3.BackColor = System.Drawing.SystemColors.Control
		Me.Command3.CausesValidation = True
		Me.Command3.Enabled = True
		Me.Command3.ForeColor = System.Drawing.SystemColors.ControlText
		Me.Command3.Cursor = System.Windows.Forms.Cursors.Default
		Me.Command3.RightToLeft = System.Windows.Forms.RightToLeft.No
		Me.Command3.TabStop = True
		Me.Command3.Name = "Command3"
		Me.Text1.AutoSize = False
		Me.Text1.Size = New System.Drawing.Size(461, 209)
		Me.Text1.Location = New System.Drawing.Point(0, 112)
		Me.Text1.MultiLine = True
		Me.Text1.ScrollBars = System.Windows.Forms.ScrollBars.Vertical
		Me.Text1.TabIndex = 2
		Me.Text1.AcceptsReturn = True
		Me.Text1.TextAlign = System.Windows.Forms.HorizontalAlignment.Left
		Me.Text1.BackColor = System.Drawing.SystemColors.Window
		Me.Text1.CausesValidation = True
		Me.Text1.Enabled = True
		Me.Text1.ForeColor = System.Drawing.SystemColors.WindowText
		Me.Text1.HideSelection = True
		Me.Text1.ReadOnly = False
		Me.Text1.Maxlength = 0
		Me.Text1.Cursor = System.Windows.Forms.Cursors.IBeam
		Me.Text1.RightToLeft = System.Windows.Forms.RightToLeft.No
		Me.Text1.TabStop = True
		Me.Text1.Visible = True
		Me.Text1.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D
		Me.Text1.Name = "Text1"
		Me.Command2.TextAlign = System.Drawing.ContentAlignment.MiddleCenter
		Me.Command2.Text = "退出程序"
		Me.Command2.Size = New System.Drawing.Size(85, 25)
		Me.Command2.Location = New System.Drawing.Point(376, 56)
		Me.Command2.TabIndex = 1
		Me.Command2.BackColor = System.Drawing.SystemColors.Control
		Me.Command2.CausesValidation = True
		Me.Command2.Enabled = True
		Me.Command2.ForeColor = System.Drawing.SystemColors.ControlText
		Me.Command2.Cursor = System.Windows.Forms.Cursors.Default
		Me.Command2.RightToLeft = System.Windows.Forms.RightToLeft.No
		Me.Command2.TabStop = True
		Me.Command2.Name = "Command2"
		Me.Command1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter
		Me.Command1.Text = "数据发送"
		Me.Command1.Size = New System.Drawing.Size(85, 25)
		Me.Command1.Location = New System.Drawing.Point(376, 84)
		Me.Command1.TabIndex = 0
		Me.Command1.BackColor = System.Drawing.SystemColors.Control
		Me.Command1.CausesValidation = True
		Me.Command1.Enabled = True
		Me.Command1.ForeColor = System.Drawing.SystemColors.ControlText
		Me.Command1.Cursor = System.Windows.Forms.Cursors.Default
		Me.Command1.RightToLeft = System.Windows.Forms.RightToLeft.No
		Me.Command1.TabStop = True
		Me.Command1.Name = "Command1"
		Me.Label7.Text = "0"
		Me.Label7.Size = New System.Drawing.Size(57, 17)
		Me.Label7.Location = New System.Drawing.Point(4, 60)
		Me.Label7.TabIndex = 17
		Me.Label7.TextAlign = System.Drawing.ContentAlignment.TopLeft
		Me.Label7.BackColor = System.Drawing.SystemColors.Control
		Me.Label7.Enabled = True
		Me.Label7.ForeColor = System.Drawing.SystemColors.ControlText
		Me.Label7.Cursor = System.Windows.Forms.Cursors.Default

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -