if (m_dialogtype == DIALOG_TYPE_VIEW) { SetWindowText(L"打扎信息查看"); GetDlgItem(IDC_BUTTON1)->EnableWindow(false); GetDlgItem(IDC_BUTTON2)->EnableWindow(false); GetDlgItem(IDC_BUTTON4)->EnableWindow(false); GetDlgItem(IDC_BUTTON5)->EnableWindow(false); GetDlgItem(IDC_BUTTON6)->EnableWindow(false); GetDlgItem(IDC_BUTTON8)->EnableWindow(false); GetDlgItem(IDC_BUTTON9)->EnableWindow(false); GetDlgItem(IDOK)->EnableWindow(false); ((CEdit*)GetDlgItem(IDC_EDIT4))->SetReadOnly(); ((CEdit*)GetDlgItem(IDC_EDIT14))->SetReadOnly(); ((CEdit*)GetDlgItem(IDC_EDIT15))->SetReadOnly(); } if (m_dialogtype == DIALOG_TYPE_VIEW) { SetWindowText(L"打扎信息查看"); GetDlgItem(IDC_BUTTON1)->EnableWindow(false); GetDlgItem(IDC_BUTTON2)->EnableWindow(false); GetDlgItem(IDC_BUTTON4)->EnableWindow(false); GetDlgItem(IDC_BUTTON5)->EnableWindow(false); GetDlgItem(IDC_BUTTON6)->EnableWindow(false); GetDlgItem(IDC_BUTTON8)->EnableWindow(false); GetDlgItem(IDC_BUTTON9)->EnableWindow(false); GetDlgItem(IDOK)->EnableWindow(false); ((CEdit*)GetDlgItem(IDC_EDIT4))->SetReadOnly(); ((CEdit*)GetDlgItem(IDC_EDIT14))->SetReadOnly(); ((CEdit*)GetDlgItem(IDC_EDIT15))->SetReadOnly(); }