The following works as expected.
However, the enumeration of StopBits includes a value(None) that can't be assigned to a SerialPorts StopBits property. If you try you get System.ArgumentOutOfRangeException.Code:Dim xStopBits As Array = [Enum].GetValues(GetType(IO.Ports.StopBits)) ComboBox1.DataSource = xStopBits
My question is how can I remove xStopBits(0) before setting the DataSource?
To get around this I currently have a check in the ComboBox1_SelectedIndexChanged event.




Reply With Quote