a device barcode scanner attached to the system is not functioning
<pre>Imports System Imports System.IO.Ports Public WithEvents sp As New System.IO.Ports.SerialPort If Me.Parity.SelectedIndex = 0 Then sp.Parity = IO.Ports.Parity.Even ElseIf Me.Parity.SelectedIndex = 1 Then sp.Parity = IO.Ports.Parity.Mark ElseIf Me.Parity.SelectedIndex = 2 Then sp.Parity = IO.Ports.Parity.None ElseIf Me.Parity.SelectedIndex = 3 Then sp.Parity = IO.Ports.Parity.Odd ElseIf Me.Parity.SelectedIndex = 4 Then sp.Parity = IO.Ports.Parity.Space End If If Me.StopBits.SelectedIndex = 0 Then sp.StopBits = IO.Ports.StopBits.None ElseIf Me.StopBits.SelectedIndex = 1 Then sp.StopBits = IO.Ports.StopBits.One ElseIf Me.StopBits.SelectedIndex = 2 Then sp.StopBits = IO.Ports.StopBits.OnePointFive ElseIf Me.StopBits.SelectedIndex = 3 Then sp.StopBits = IO.Ports.StopBits.Two End If If Me.Handshake.SelectedIndex = 0 Then sp.Handshake = IO.Ports.Handshake.None ElseIf Me.Handshake.SelectedIndex = 1 Then sp.Handshake = IO.Ports.Handshake.RequestToSend ElseIf Me.Handshake.SelectedIndex = 2 Then sp.Handshake = IO.Ports.Handshake.RequestToSendXOnXOff ElseIf Me.Handshake.SelectedIndex = 3 Then sp.Handshake = IO.Ports.Handshake.XOnXOff End If Dim sPort As New IO.Ports.SerialPort(Me.ComboBox1.Text, Me.TextBox1.Text, sp.Parity, Me.DataBits.Text, sp.StopBits) sPort.Handshake = sp.Handshake sPort.RtsEnable = IIf(Me.CheckBox1.Checked = True, True, False) sPort.DtrEnable = IIf(Me.CheckBox2.Checked = True, True, False) If sPort.IsOpen = False Then sPort.Open() End If
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)