VERSION 5.00 Object = "{648A5603-2C6E-101B-82B6-000000000014}#1.1#0"; "MSCOMM32.OCX" Begin VB.Form Form1 Caption = "Form1" ClientHeight = 3195 ClientLeft = 60 ClientTop = 345 ClientWidth = 4680 LinkTopic = "Form1" ScaleHeight = 3195 ScaleWidth = 4680 StartUpPosition = 3 'Windows Default WindowState = 2 'Maximized Begin MSCommLib.MSComm MSComm1 Left = 840 Top = 2880 _ExtentX = 1005 _ExtentY = 1005 _Version = 393216 DTREnable = -1 'True RThreshold = 1 End Begin VB.CommandButton cmdclear Caption = "clear" Height = 495 Left = 3120 TabIndex = 1 Top = 2400 Width = 1095 End Begin VB.TextBox txtdisplay Height = 855 Left = 1560 TabIndex = 0 Top = 720 Width = 2895 End Begin VB.Label Label1 Caption = "Label1" Height = 495 Left = 600 TabIndex = 3 Top = 2040 Width = 1335 End Begin VB.Label lbldisplay Caption = "Label1" Height = 975 Left = 3840 TabIndex = 2 Top = 3720 Width = 2055 End End Attribute VB_Name = "Form1" Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = False Attribute VB_PredeclaredId = True Attribute VB_Exposed = False Dim dat As Integer Private Sub Form_Load() MSComm1.PortOpen = True MSComm1.Output = "shi" End Sub Private Sub lbldisplay_Click() lbldisplay.Caption = Chr(KeyAscii) End Sub Private Sub MSComm1_OnComm() Dim s As String s = MSComm1.Input Label1.Caption = s If s = "e" Then s = "shie" MSComm1.Output = s MSComm1.Output = MSComm1.Input End If End Sub