-
September 27th, 2012, 01:34 AM
#1
Working with more than one form?
Hi There, how are you?
I'm currently trying to work with more than one form, but I didn't succeed yet. What I need is quite simple: Once the program runs, a small form appears first asking "what would you like to do" with corresponding buttons for each option. Each button loads a new different form for a different task. So basically I need to open and close forms, also having two forms loaded at the same time (pop-up style) would be great for certain purposes.
I know it may sound simple, but although I've searched already, I still haven't figured how to do it properly. I'm currently using VC++ 2008 and my project is a Windows Forms Application. Any help will be greatly appreciated!
Thanks a lot!
-
September 27th, 2012, 01:32 PM
#2
Re: Working with more than one form?
Windows Forms Application problems are discussed in the appropriate Forums like:
Managed C++ and C++/CLI
or some of the .NET Programming one
Victor Nijegorodov
-
September 27th, 2012, 01:39 PM
#3
Re: Working with more than one form?
Code:
//Leave this in your event handle
FormClass x=new FormClass();
x.Show();
-
September 27th, 2012, 05:05 PM
#4
Re: Working with more than one form?
Ok, one step at a time. My biggest problem is that I can't find a way to make the form RETURN a value when it closes.
My idea is that depending on what the user chooses at the first form, it returns an specific value. For example, Form 1 has button1, button2 and button3. If uses clicks button2, it closes and returns 2.
Sounds simple but I've been having a hell of a hard time trying to figure it out! Any ideas?
Thanks!!
-
September 27th, 2012, 08:21 PM
#5
Re: Working with more than one form?
To add to what VictorN posted, this is the link to the correct forum section: http://forums.codeguru.com/forumdisp...ed-C-and-C-CLI
Originally Posted by fernando306
Ok, one step at a time. My biggest problem is that I can't find a way to make the form RETURN a value when it closes.
[...]
Sounds simple but I've been having a hell of a hard time trying to figure it out! Any ideas?
Given that description, there are several potential approaches, which one being best fit depending on specifics of the concrete scenario that are yet unknown. Discussing that here would certainly be too off-topic. So please repost your question in the appropriate forum section (see above) unless a moderator already has moved this thread over there by the time you read this.
Originally Posted by thefollower
Code:
//Leave this in your event handle
FormClass x=new FormClass();
x.Show();
That's C#.
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.
-
September 27th, 2012, 09:20 PM
#6
Re: Working with more than one form?
I am really sorry, I'm new here and I'm a little lost with all these forum sections. As you advised me, I opened a new thread here:
http://forums.codeguru.com/showthrea...53#post2086653
Thank you! I look forward to your input.
Tags for this Thread
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
|