在MFC VC ++ 6.0中在运行时触发ON_BN_CLICKED事件 [英] Trigger ON_BN_CLICKED event at runtime in MFC VC++ 6.0

查看:768
本文介绍了在MFC VC ++ 6.0中在运行时触发ON_BN_CLICKED事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在运行时触发ON_BN_CLICKED事件?

例如,当我单击第二个对话框的按钮时,我想触发第一个对话框中的按钮的单击事件.

我正在使用Microsoft Visual C ++ 6.0 MFC.

在此先感谢您.

How to trigger ON_BN_CLICKED event at runtime?

For example, I want to trigger the click event of a Button in my first Dialog when I click a Button of my second Dialog.

I am using Microsoft Visual C++ 6.0 MFC.

Thanks in advance.

推荐答案

我假定您已设置为在第二个对话框中处理按钮事件.

在这种情况下,您要做的就是将消息发送到第一页中的按钮.这可以通过以下方式完成:

I assume that you have set up for handling the button event in the second dialog.

In this event all you have to do is to send the message to the button in the first page. This can be done by:

SendMessage(WM_COMMAND,
             MAKEWPARAM(IDC_MY_FIRST_BUTTON, BN_CLICKED),
            (LPARAM) m_MyFirstButton.m_hWnd);


这篇关于在MFC VC ++ 6.0中在运行时触发ON_BN_CLICKED事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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