Imports System Imports System.Threading Imports System.IO.Ports Imports System.ComponentModel Public Class Form1 Dim myport As Array Delegate Sub settextcallback(ByVal [text] As String) Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load myport = IO.Ports.SerialPort.GetPortNames() Printer_Comport.Items.AddRange(myport) End Sub Private Sub Printer_Comport_MouseClick(sender As Object, e As MouseEventArgs) Handles Printer_Comport.MouseClick Printer_Comport.Items.Clear() myport = IO.Ports.SerialPort.GetPortNames Printer_Comport.Items.AddRange(myport) End Sub Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click SerialPort1.PortName = Printer_Comport.Text 'Heres where I get error SerialPort1.BaudRate = 9600 SerialPort1.Open() SerialPort1.Write("Hello World") SerialPort1.Close() End Sub End Class
Open
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)