From 61deef5cdf96cbfdd6ad45be49e80d597c00ca65 Mon Sep 17 00:00:00 2001
From: QuakeGod <QuakeGod@sina.com>
Date: 星期二, 24 十二月 2024 08:37:21 +0800
Subject: [PATCH] 2024-12-24

---
 KLink1/CDialogCommSet1.cpp |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/KLink1/CDialogCommSet1.cpp b/KLink1/CDialogCommSet1.cpp
index fb57d19..72b3c7c 100644
--- a/KLink1/CDialogCommSet1.cpp
+++ b/KLink1/CDialogCommSet1.cpp
@@ -155,9 +155,13 @@
 int CDialogCommSet1::ShowParams()
 {
 	// TODO: 鍦ㄦ澶勬坊鍔犲疄鐜颁唬鐮�.
+	CString s1;
 	((CComboBox *)GetDlgItem(IDC_COMBO_NETWORK_TYPE))->SetCurSel(0);
-	((CComboBox *)GetDlgItem(IDC_COMBO_PORT))->SetCurSel(0);
+
+	((CComboBox *)GetDlgItem(IDC_COMBO_PORT))->SetCurSel(m_nComNum-1);
 	((CComboBox *)GetDlgItem(IDC_COMBO_BAUD))->SetCurSel(7);
+	s1.Format(_T("%d"), m_nBaudRate);
+	((CComboBox*)GetDlgItem(IDC_COMBO_BAUD))->SelectString(0, s1);
 
 	((CButton *)GetDlgItem(IDC_RADIO_DATA_LENGTH_8B))->SetCheck(1);
 
@@ -172,7 +176,6 @@
 
 	UpdateComPortList();
 
-	CString s1;
 	if (m_bOpened) s1 = _T("宸茶繛鎺�"); else s1 = _T("鏈繛鎺�");
 	((CStatic*)GetDlgItem(IDC_STATIC_STATE))->SetWindowText(s1);
 	return 0;
@@ -187,6 +190,7 @@
 	CString baudstr;
 	GetDlgItemText(IDC_COMBO_BAUD, baudstr);
 	m_nBaudRate = _tstoi(baudstr);
+
 	m_Settings = "8,N,1";
 
 	((CButton *)GetDlgItem(IDC_RADIO_DATA_LENGTH_8B))->GetCheck();

--
Gitblit v1.9.1