简体   繁体   English

基于MFC对话框的应用程序中WindowsFormsControlLibrary按钮的click事件

[英]click event of WindowsFormsControlLibrary button in MFC Dialog based app

I'm using some Windows Forms Control Library elements in my app. 我在我的应用程序中使用了一些Windows Forms Control Library元素。

My question is: 我的问题是:

How to perform button click event which this element comes from Windows Forms Control Library? 如何执行此元素来自Windows窗体控件库的按钮单击事件?

So, I can get *library* textbox value in ProgramDlg.cpp file like this: 因此,我可以在ProgramDlg.cpp文件中获得*library*文本框值,如下所示:

void CMFCApplication1Dlg::OnBnClickedButton1()
{
    // TODO: Add your control notification handler code here
    AfxMessageBox(CString(m_ctrl1.GetControl()->textBox1->Text));
    // m_ctrl1.GetControl()->button1->Click(); 
    // how can I write this above line to perform click event?
}

I defined m_ctrl1 in ProgramDlg.h : 我在ProgramDlg.h定义了m_ctrl1

// .... 
public:
        CMFCApplication1Dlg(CWnd* pParent = NULL);  // standard constructor
        // Data member for the .NET User Control:
        CWinFormsControl<WindowsFormsControlLibrary1::UserControl1> m_ctrl1;
// ....

ps sorry for my bad english. ps对不起,我的英语不好。

Thanks. 谢谢。

I solved my problem by visiting this link . 我通过访问此链接解决了我的问题。

Hope to be useful for other developers. 希望对其他开发人员有用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 防止双击MFC-Dialog按钮 - Prevent double click on MFC-Dialog button 如何在基于对话框的 MFC 应用程序上启用滚动? - How to enable scrolling on Dialog Based MFC app? 在主对话框中嵌入对话框,并在MFC中单击按钮切换它们 - Embedding dialogs in main dialog and switching them with button click in MFC 如何在基于 MFC 对话框的应用程序中为复选框捕获 MouseMove 事件? - How to capture MouseMove event in a MFC Dialog Based application for a checkbox? 允许用户在基于对话框的 MFC 应用程序上选择文件夹和文件 - Enable user to choose folders and files on dialog based MFC app MFC 在基于对话框的应用程序中在 OnPaint 之外绘制内容 - MFC Draw Stuff Outside OnPaint in a Dialog-based App 单击 MFC 气球工具提示的“X”关闭按钮会发送什么事件? - What event is sent by a click on the “X” close button for an MFC balloon tooltip? MFC:如何根据按钮单击交替显示两个组框? - MFC : How to display two group boxes alternatively based on a button click? 如何创建自定义组件并将其添加到基于对话框的应用程序(MFC)? - How to create and add a custom made component to a Dialog based app (MFC)? 在基于对话框的MFC应用程序中添加对打印和预览HTML的支持 - Add support to print & preview HTML in a dialog-based MFC app
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM