Auto select comport
This commit is contained in:
@@ -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";
|
||||||
|
|||||||
Reference in New Issue
Block a user