?? formok.frm
字號(hào):
VERSION 5.00
Object = "{648A5603-2C6E-101B-82B6-000000000014}#1.1#0"; "MsComm32.ocx"
Begin VB.Form Form1
Caption = "RS232_VB"
ClientHeight = 4005
ClientLeft = 60
ClientTop = 345
ClientWidth = 4680
LinkTopic = "Form1"
ScaleHeight = 4005
ScaleWidth = 4680
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton Button_RECV
Caption = "接收數(shù)據(jù)"
Height = 495
Left = 480
TabIndex = 7
Top = 3000
Width = 1455
End
Begin VB.Timer Timer1
Left = 3840
Top = 240
End
Begin MSCommLib.MSComm MSComm
Left = 3840
Top = 840
_ExtentX = 1005
_ExtentY = 1005
_Version = 393216
DTREnable = -1 'True
End
Begin VB.CommandButton Button_RECV_C
Caption = "清空接收文本框"
Height = 495
Left = 2400
TabIndex = 6
Top = 3000
Width = 1455
End
Begin VB.TextBox Text_RECV
Height = 375
Left = 2040
TabIndex = 5
Text = "Text2"
Top = 2160
Width = 1575
End
Begin VB.CommandButton Button_SEND_C
Caption = "清空發(fā)送數(shù)據(jù)"
Height = 495
Left = 2040
TabIndex = 3
Top = 1320
Width = 1695
End
Begin VB.CommandButton Button_SEND
Caption = "發(fā)送數(shù)據(jù)"
CausesValidation= 0 'False
Height = 495
Left = 480
TabIndex = 2
Top = 1320
Width = 1335
End
Begin VB.TextBox Text_SEND
Height = 375
Left = 1560
TabIndex = 1
Text = "Text1"
Top = 360
Width = 1815
End
Begin VB.Label Label2
Caption = "接收數(shù)據(jù)"
Height = 255
Left = 600
TabIndex = 4
Top = 2280
Width = 855
End
Begin VB.Label Label1
Caption = "發(fā)送數(shù)據(jù)"
Height = 255
Left = 360
TabIndex = 0
Top = 480
Width = 855
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Button_RECV_C_Click()
Text_RECV.Text = ""
Text_SEND.SetFocus
End Sub
Private Sub Button_RECG_C_Click()
End Sub
Private Sub Button_SEND_C_Click()
Text_SEND.Text = ""
Text_SEND.SetFocus
End Sub
Private Sub Button_SEND_Click()
Dim x As String
If Text_SEND.Text = "" Then
x = MsgBox("發(fā)送數(shù)據(jù)不能空", 16)
Exit Sub
End If
If Not MSComm.PortOpen = True Then
End If
MSComm.Output = Text_SEND.Text + Chr$(13)
For i = 1 To 20000000
Next
End Sub
Private Sub Command1_Click()
End Sub
Private Sub Form_Load()
MSComm.CommPort = 1
MSComm.Settings = "2400,N,8,1"
MSComm.InputLen = 0
MSComm.InBufferSize = 1024
MSComm.OutBufferSize = 512
MSComm.PortOpen = True
MSComm.SThreshold = 0
MSComm.RThreshold = 1
MSComm.InBufferCount = 0
MSComm.OutBufferCount = 0
Me.Caption = Now()
Text_SEND.Text = ""
Text_RECV.Text = ""
End Sub
Private Sub Label1_Click()
Me.Caption = Now()
End Sub
Private Sub MSComm_OnComm()
Select Case MSComm.CommEvent
Case comEventOverrun
Text_SEND.Text = ""
Text_RECV.Text = ""
Text_SEND.SetFocus
Exit Sub
Case comEventRxOver
Text_SEND.Text = ""
Text_RECV.Text = ""
Text_SEND.SetFocus
Exit Sub
Case comEventTxFull
Text_SEND.Text = ""
Text_RECV.Text = ""
Text_SEND.SetFocus
Exit Sub
Case comEvReceive
Dim str As String
str = MSComm.Input
Text_RECV.Text = Text_RECV.Text + str
End Select
End Sub
Private Sub Timer1_Timer()
Me.Caption = Now()
End Sub
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -