TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
ron-rohrssen
NA
3
0
Passing a form as an argument
Dec 11 2003 3:51 PM
I want to show a dialog and when the form (dialog) is closed, return to the calling form. The calling form should then be able to pass the child form to another object with the form as a parameter. For example, FormOptions formOptions = new FormOptions(); if (formOptions.ShowDialog(this) == DialogResult.OK) { ConfigurationManager configurationManager = new ConfigurationManager(); configurationManager.saveConfiguration(formOptions); } formOptions.Dispose(); My ConfigurationManager has a method that looks like this: public void saveConfiguration(FormOptions formOptions) { ConfigurationData configurationData = new ConfigurationData (formOptions); saveConfiguration(configurationData); } When I build this code I keep getting an error like this: ConfigurationData.cs(20): The type or namespace name 'FormOptions' could not be found (are you missing a using directive or an assembly reference?) These classes are all within the same namespace. Is it possible to pass the form object to another class? Or do I need to extract values from the form and pass them on to my ConfigurationManager?
Reply
Answers (
2
)
printing a panel
C# And VB.NET