回覆列表
  • 1 # 莫過於旅遊

    定義委託然後在DataReceived事件中處理(不需要延時)Delegate Sub SetTextCallback(ByVal InputString As String) Private Sub ShowString(ByVal comData As String) txt_Rect.Text += comData "將收到的資料入接收文字框中 txt_Rect.SelectionStart = txt_Rect.Text.Length txt_Rect.ScrollToCaret() End Sub Private Sub SerialPort1_DataReceived(ByVal sender As Object, ByVal e As System.IO.Ports.SerialDataReceivedEventArgs) Handles SerialPort1.DataReceived Dim inData As String = SerialPort1.ReadExisting Dim d As New SetTextCallback(AddressOf ShowString) BeginInvoke(d, inData) End Sub

  • 中秋節和大豐收的關聯?
  • 常規客機起飛前有什麼檢查,為什麼會出現在高空中飛機玻璃破碎的情況?