From 4a1d72850cf1d28c3f5f99f93dcb0136089a0918 Mon Sep 17 00:00:00 2001
From: LAPTOP-SNT8I5JK\Boounion <Chenluhua@qq.com>
Date: 星期二, 03 十二月 2024 16:34:33 +0800
Subject: [PATCH] 1.IO页面,上一页、下一页按钮根据页号禁用或启用; 2.PLC页,修复在连接前打开闪退的问题。同进根据连接状态启用或禁用按钮组;

---
 SourceCode/Bond/BondEq/View/IOMonitoringDlg.cpp |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/SourceCode/Bond/BondEq/View/IOMonitoringDlg.cpp b/SourceCode/Bond/BondEq/View/IOMonitoringDlg.cpp
index f707501..dfc430a 100644
--- a/SourceCode/Bond/BondEq/View/IOMonitoringDlg.cpp
+++ b/SourceCode/Bond/BondEq/View/IOMonitoringDlg.cpp
@@ -502,6 +502,8 @@
 
 	CreateDynamicControls();
 	DisplayCurrentPage();
+	GetDlgItem(IDC_BUTTON_PREV_PAGE)->EnableWindow(m_nCurrentPage > 1);
+	GetDlgItem(IDC_BUTTON_NEXT_PAGE)->EnableWindow(m_nCurrentPage < m_nTotalPages);
 
 	SetTimer(TIMER_READ_PLC_DATA, 500, nullptr);
 
@@ -535,6 +537,9 @@
 	else {
 		AfxMessageBox(_T("宸茬粡鏄涓�椤碉紒"));
 	}
+
+	GetDlgItem(IDC_BUTTON_PREV_PAGE)->EnableWindow(m_nCurrentPage > 1);
+	GetDlgItem(IDC_BUTTON_NEXT_PAGE)->EnableWindow(m_nCurrentPage < m_nTotalPages);
 }
 
 void CIOMonitoringDlg::OnBnClickedButtonNextPage()
@@ -547,6 +552,9 @@
 	else {
 		AfxMessageBox(_T("宸茬粡鏄渶鍚庝竴椤碉紒"));
 	}
+
+	GetDlgItem(IDC_BUTTON_PREV_PAGE)->EnableWindow(m_nCurrentPage > 1);
+	GetDlgItem(IDC_BUTTON_NEXT_PAGE)->EnableWindow(m_nCurrentPage < m_nTotalPages);
 }
 
 void CIOMonitoringDlg::OnTimer(UINT_PTR nIDEvent)

--
Gitblit v1.9.3