简体   繁体   中英

How can i check that button is clicked in no modal dialog

I created main dialog and call no modal dialog, how can i check in main dialog that button is clicked in no modal?

For example if i call modal i can check like this:

Dialog Dlg;
int DlgResult = static_cast<int>(Dlg.DoModal());

if (DlgResult== IDOK)
{                               
   //do smth.
}

如果它是自定义对话框,则一种方法是在非模式对话框关闭时使用SendMessage()PostMessage()将结果发送到主对话框。

Even after the window closes, you will still have access to the C++ object representing the dialog. You can override OnOK and OnCancel and have them save a flag in the object.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM