Auto select comport

This commit is contained in:
2015-11-01 18:52:28 +01:00
parent 92c1712491
commit dd56192670
@@ -121,9 +121,11 @@ namespace ErgometerSimulator
// ComPortBox // ComPortBox
// //
this.ComPortBox.FormattingEnabled = true; this.ComPortBox.FormattingEnabled = true;
this.ComPortBox.Items.AddRange(new object[] { this.ComPortBox.Items.AddRange(SerialPort.GetPortNames());
"COM6", if (ComPortBox.Items.Count > 0)
"COM7"}); this.ComPortBox.SelectedIndex = 0;
if (ComPortBox.Items.Count > 1)
this.ComPortBox.SelectedIndex = 1;
this.ComPortBox.Location = new System.Drawing.Point(11, 250); this.ComPortBox.Location = new System.Drawing.Point(11, 250);
this.ComPortBox.Margin = new System.Windows.Forms.Padding(2); this.ComPortBox.Margin = new System.Windows.Forms.Padding(2);
this.ComPortBox.Name = "ComPortBox"; this.ComPortBox.Name = "ComPortBox";