我从windows c#
获得了这段代码 private void frmMain_Load(object sender, EventArgs e)
{
serialPort1.Open();
if (serialPort1.IsOpen)
{
this.serialPort1.DataReceived += new System.IO.Ports.SerialDataReceivedEventHandler(this.serialPort1_DataReceived);
}
}
我正在使用 Converter 将其转换为Windows表单代码。
转换后我得到了这段代码
Private Sub frmMain_Load(sender As Object, e As EventArgs)
serialPort1.Open()
If serialPort1.IsOpen Then
Me.serialPort1.DataReceived += New System.IO.Ports.SerialDataReceivedEventHandler(Me.serialPort1_DataReceived)
End If
End Sub
但我在Me.serialPort1.DataReceived
中遇到问题,请参阅下面的图片