|
-
April 17th, 2011, 06:55 AM
#1
Can't check menu items in a dialog - Please help!
Hi guys,
I would like you to help me. I am using managed C++/CLI. I have figure out that I will get the errors of 'Form2' : undeclared identifier as if I included the "#include Form1.h" on the top of the Form2 class while I have the "#include Form2.h" on the top of the Form1 header.
This is how I found the problem to get it solve, if I remove the "#include Form2.h" on the top of the Form1 header, the problem would solve but I cannot open the form2 dialog.
What I am trying to do is to open the form2 dialog and check on the Form1 menu items that if any of the menu items checked is set to true or false then do something.
I have included the attachment, so you can take a look and see what I mean if you don't get this.
Please can you help me to fix this as I find it very difficult to deals with?
Once you open the attachment and if you find a way to solve this, please could you save them, reattach and post them back.
http://www.yourfilelink.com/get.php?fid=652705
Thanks,
Mark
-
April 17th, 2011, 04:10 PM
#2
Re: Can't check menu items in a dialog - Please help!
Have you tried what I suggested over there in the other thread: http://www.codeguru.com/forum/showthread.php?p=2009741? If yes, what was the result?
I was thrown out of college for cheating on the metaphysics exam; I looked into the soul of the boy sitting next to me.
This is a snakeskin jacket! And for me it's a symbol of my individuality, and my belief... in personal freedom.
-
April 17th, 2011, 07:11 PM
#3
Re: Can't check menu items in a dialog - Please help!
 Originally Posted by Eri523
As I have answered to your post, i still get the same result as I keep getting the same errors as I has got. I would appreciate if you could post the source code for both forms, so hopefully the problem would solve there.
-
April 19th, 2011, 05:26 PM
#4
Re: Can't check menu items in a dialog - Please help!
-
April 20th, 2011, 05:12 AM
#5
Re: Can't check menu items in a dialog - Please help!
What I am trying to do is to open the form2 dialog and check on the Form1 menu items that if any of the menu items checked is set to true or false then do something.
This indicates an error in your design.
You should not have child forms directly accessing their parents UI elements.
Instead your parent form should handle events from their UI elements (i.e. in your case menu items) and then pass this data (via methods, properties etc) down to their children.
Forms (certainly in my opinion) should be self contained and only know and can access their own UI items.
Passing messages from children to parents can be done via events, passing messages from parents to children can be done via methods or properties.
Darwen.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|