den 2 form
Private Sub Command1_Click()
If MSComm1.PortOpen = True Then
MSComm1.Output = "a"
Else
MsgBox "Port isn't opened", vbCritical, "Error"
End If
End Sub
Private Sub Command5_Click()
If MSComm1.PortOpen = True Then
MSComm1.PortOpen = False
Else
MSComm1.PortOpen = True
MsgBox "Port is now opened", vbOKOnly, "Welcome"
End If
Form8.Show
End Sub
Private Sub MSComm2_OnComm()
Dim s As Variant
kt = MSComm2.Input
Select Case kt
Case "a"
If Shape1.FillColor = &H0& Then
Shape1.FillColor = &HFF00&
Shape2.FillColor = &H0&
Shape3.FillColor = &H0&
Else
Shape1.FillColor = &H0&
End If
Case "b"
If Shape2.FillColor = &H0& Then
Shape2.FillColor = &HFFFF&
Shape1.FillColor = &H0&
Shape3.FillColor = &H0&
Else
Shape2.FillColor = &H0&
End If
Case "c"
If Shape3.FillColor = &H0& Then
Shape3.FillColor = &HFF&
Shape1.FillColor = &H0&
Shape2.FillColor = &H0&
Else
Shape3.FillColor = &H0&
End If
Case "d"
Shape1.FillColor = &H0&
Shape2.FillColor = &H0&
Shape3.FillColor = &H0&
End Select
End Sub
Bạn đang đọc truyện trên: AzTruyen.Top