强制从另一个孩子更新一个无模式子对话框 [英] Forcing an update of one modeless child dialog from another child

查看:78
本文介绍了强制从另一个孩子更新一个无模式子对话框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的第一个项目运行良好,直到尝试使其更具视觉吸引力为止.

初始化后,我的主对话框将创建一个输出对话框,其中包含三部分只读字段.主对话框有3个按钮,每个按钮都产生一个与输出对话框的一部分相对应的对话框.正是从这些用户输入对话框中,允许用户更新数据/公共数据.退出后,我在maindlg的OnPaint部分的输出对话框上执行Invalidate(TRUE)以强制更新其字段.至此一切都很好.

现在,我在3个用户输入对话框中设置x/y坐标,使其弹出在相应输出部分的下面,而不是在maindlg的顶部.现在,我看到,退出时maindlg无需绘画".

因此,如何在每个用户输入对话框中强制所有outdlg进行更新,而所有这些对话框都是maindlg的子级. >从对话框1到对话框2的用户定义消息. Dialog-2处理此用户定义的消息并使其自身无效.


My first project was working fine until I tried making it more visually appealing.

On initilization, my main dialog creates an output dialog with three sections of read-only fields. The main dialog has 3 buttons, each producing a dialog corresponding to a section of the output dialog. It is from these user entry dialogs where the user is allowed to update data/common. Upon exiting I''m doing an Invalidate( TRUE ) on the output dialog in the OnPaint section of maindlg to force an update of its fields. Everything is fine to this point.

Now I set the x/y coordinates on the 3 user entry dialogs to pop up just beneath the corresponding output section, rather than on top of maindlg. Now, I see, the maindlg has no need to "paint" when I exit.

So, how can I force an update of my outdlg from each of my user entry dialogs, all being childs of maindlg.

解决方案

The typical approach used is to PostMessage a user-defined message from dialog-1 to dialog-2. Dialog-2 handles this user-defined messages and invalidates itself.


这篇关于强制从另一个孩子更新一个无模式子对话框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆