繁体   English   中英

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

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

我在我的应用程序中使用了一些Windows Forms Control Library元素。

我的问题是:

如何执行此元素来自Windows窗体控件库的按钮单击事件?

因此,我可以在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?
}

我在ProgramDlg.h定义了m_ctrl1

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

ps对不起,我的英语不好。

谢谢。

我通过访问此链接解决了我的问题。

希望对其他开发人员有用。

暂无
暂无

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

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