CModifyDialog派生于CAdUiBaseDialog,以下代码“确定”关闭对话框时 会闪烁。
void CModifyDialog::OnOK() { CAdUiBaseDialog::OnOK(); CModifyDialog::BeginEditorCommand(); NewEntityIfNeed() ; CModifyDialog::CompleteEditorCommand() ; }
以下代码无法输入:
void CModifyDialog::OnOK() { CAdUiBaseDialog::OnOK(); //CModifyDialog::BeginEditorCommand(); NewEntityIfNeed() ; //CModifyDialog::CompleteEditorCommand() ; }
解决方法:
void CModifyDialog::OnOK() { CAdUiBaseDialog::OnOK(); CModifyDialog::BeginEditorCommand(); NewEntityIfNeed() ; CModifyDialog::CompleteEditorCommand(FALSE) ; }