开发者

Parent/Child forms communication issue

I am very new to Visual C++ programming, but I have to write simpl开发者_开发问答e program which needs to do two things: ( I am using MS Visual C++ )

  1. main ( parent ) form should be displayed when program starts, and after clicking a button on it, second form should be shown.
  2. Second form ( child ) also has a button, but this one should ( after clicking, of course ) show current X,Y child form position but on ( important ) parent form.

And this is where i got stuck.

I can display child form with:

a) adding #include "child.h" in parent form.h

b) adding child ^child_form; in public: section

and afterwards using:

child_form = gcnew child();

child_form->Show();

I was googling for two days now and cannot find a way to get it the other way: click on a button on child_form and display it's coordinates on parent form on label->text :/

when i tried to add #include "child.h" in child_form I just got error saying: "there are to many include files..."

I really need to get this done and I would really appreciate any suggestions.

Thanks in advance :)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜