【发布时间】:2016-03-15 05:44:47
【问题描述】:
我对 c++ 很陌生,到目前为止,我在理解基础知识方面有点困难。我现在有 2 个表格。
父.h
#include "child.h"
public ref class parent : public System::Windows::Forms::Form {
child^ v_child = gcnew child;
void InitializeComponent(void){
v_child->Load += gcnew System::EventHandler(v_child, &child::child_Load);
}
private: System::Void child_Load(System::Object^ sender, System::EventArgs^ e) {
MessageBox::Show("Howdy");
}
}
我基本上希望父母在孩子有事件时做一些事情,在这种情况下,只是一个负载。它编译并且不给出警告/错误,子执行事件,但它从不触发父事件。 想要这样做是为了能够在父母和孩子之间进行互动,到目前为止,我在这样做时遇到了很多麻烦。
【问题讨论】:
标签: forms c++-cli parent-child eventhandler