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
michael
NA
3
0
Advanced forms collection
Apr 18 2008 10:42 AM
Hello
I am trying to create a windows project with an advanced form collection.
What i'm trying to achieve:
a class called "Interfaces" containing all the forms in my project
e.g.
[CODE]
public class Interfaces
{
private static Interfaces uniqueInstance;
private Form1 form1;
private Form2 form2;
public static Interfaces GetInstance()
{
if (uniqueInstance == null)
{
uniqueInstance = new Interfaces();
}
return uniqueInstance;
}//GetInstance
public Form1 Form1
{
get
{
if(form1 == null || form1.IsDisposed)
{
form1 = new Form1();
}
return form1;
{
}
public Form2 Form2
{
get
{
if(form2 == null || form2.IsDisposed)
{
form2 = new Form2();
}
return form2;
{
}
}//class Interfaces
[/CODE]
and when i'd like to open a form, i would use the following code:
[CODE]
Interfaces.GetInstance().Form1.Show();
[/CODE]
This works fine, as long as the form i'm trying to open doesn't have any parameters, however, how can i use the same method for showing my forms when it DOES have parameters?
e.g.
Form1 form = new Form1("tekst",id);
Thanks in advance
Reply
Answers (
2
)
Constant IME Input Method setting for a Windows Form
ComboBoxColumn in DataGridView causes invalid operatoion exception