开发者

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.
}


If its a custom dialog, one way would be to use SendMessage() or PostMessage() to send the result to the main dialog when the non-modal dialog closes.


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜