X-Git-Url: http://git.linex4red.de/pub/USBasp.git/blobdiff_plain/071e02c6b6b4837fa9cf0b6d4c749994e02638d7..c49d4af4493f39e6f9f62f7b91d2cbe75be5e8fe:/Projects/LEDNotifier/LEDMixerApp/LEDMixer.cs?ds=inline diff --git a/Projects/LEDNotifier/LEDMixerApp/LEDMixer.cs b/Projects/LEDNotifier/LEDMixerApp/LEDMixer.cs index 6e19af8ed..dfaffed30 100644 --- a/Projects/LEDNotifier/LEDMixerApp/LEDMixer.cs +++ b/Projects/LEDNotifier/LEDMixerApp/LEDMixer.cs @@ -20,8 +20,10 @@ namespace LEDMixer private void LEDMixer_Load(object sender, EventArgs e) { - for (int i = 1; i <= 99; i++) - cbPort.Items.Add("COM" + i.ToString()); + String[] PortNames = System.IO.Ports.SerialPort.GetPortNames(); + Array.Sort(PortNames, delegate(string strA, string strB) { return int.Parse(strA.Substring(3)).CompareTo(int.Parse(strB.Substring(3))); }); + cbPort.Items.Clear(); + cbPort.Items.AddRange(PortNames); cbPort.SelectedIndex = 0;