|
-
January 19th, 2011, 10:20 AM
#1
[RESOLVED] close original form
hi everyone,
so i have a question. i have an application that uses multiple forms. but on the second form(form2) i have in the menu, an option to quit the application. how can i set the action to that menu item to close the second form, and the first form(form1)?
thanks
rockking
-
January 19th, 2011, 10:34 AM
#2
Re: close original form
If the second form has a direct reference to the form1, than you should be able to call the Close() method on it. If not, you can use events, and make the original form respond by closing itself, but you would have to modify your code just a little bit. If the application started with something like Application.Run(form1), then the process should end when the form closes.
-
January 19th, 2011, 01:14 PM
#3
Re: close original form
This is a little brute force, but Application.Quit() should kill everything.
-
January 19th, 2011, 08:29 PM
#4
Re: close original form
Expose an event from your child form that the main form can handle. When this event fires the main form can close itself.
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
|