Quantcast
Channel: Windows Forms Data Controls and Databinding forum
Viewing all articles
Browse latest Browse all 2535

May i ask how can i solve this error message (System.Windows.Forms.TextBox, Text:) i have try many way to solve but still not success to solve the problem.

$
0
0

I face the issue is after i scan my barcoede i will get this error message on my textbox1 can someone pls tell me how can i solve.

is i missing something.

Public Class Form1
    Private dataIn As String

 Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

        SerialPort.PortName = "COM1"
        SerialPort.BaudRate = CInt("9600")
        SerialPort.Parity = Parity.None
        SerialPort.StopBits = StopBits.One
        SerialPort.Handshake = Handshake.None
        SerialPort.Open()
        SerialPort.ReadTimeout = 200

        If SerialPort.IsOpen Then
            TextBox1.Text = ""
        End If
    End Sub

 Private Sub SerialPort_DataReceived(ByVal sender As System.Object, ByVal e As System.IO.Ports.SerialDataReceivedEventArgs) Handles SerialPort.DataReceived
        dataIn = SerialPort.ReadExisting
        TextBox1.Text += SerialPort.ReadExisting().ToString()
        SetText(TextBox1.ToString())

    End Sub
    Delegate Sub SetTextCallback(ByVal text As String)

    Private Sub SetText(ByVal text As String)
        If Me.TextBox1.InvokeRequired Then
            Dim d As SetTextCallback = New SetTextCallback(AddressOf SetText)
            Me.Invoke(d, New Object() {text})
        Else
            Me.TextBox1.Text = text.ToString


        End If
    End Sub


 


Viewing all articles
Browse latest Browse all 2535

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>