'When the form loads 'Enumerate available Com ports and add to ComboBox1 comPorts = IO.Ports.SerialPort.GetPortNames() For i = 0 To UBound(comPorts) ComboBox1.Items.Add(comPorts(i)) Next 'Set ComboBox1 text to first available port ComboBox1.Text = ComboBox1.Items.Item(0) 'Set SerialPort1 portname to first available port SerialPort1.PortName = ComboBox1.Text 'Set remaining port attributes SerialPort1.BaudRate = 19200 SerialPort1.Parity = IO.Ports.Parity.None SerialPort1.StopBits = IO.Ports.StopBits.One SerialPort1.DataBits = 8
SerialPort.PortName
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)