Hello
I am trying to use Combo boxes to selet the parametes used by my Serial Port like this...
Try
With serialPort
.PortName = cbbCOMPorts.Text
.BaudRate = 9600
.Parity = IO.Ports.Parity.None
.DataBits = 8
.StopBits = IO.Ports.StopBits.One
End With
serialPort.Open()
I can easily use comboboxes to set .portname, .baudrate but I want to set .parity and I dont want IO.Ports.Parity in my combobox what I do now is
If combobox.text= None then
.Parity = IO.Ports.Parity.None
Else If combobox.text= even Then
.Parity = IO.Port.Parity.Even

and so on but is their a cleaner and shorter way insted of all the If Then statements?

Thanks or any help..