Click here to Skip to main content
15,904,416 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Trying to make a form open another one in c#,



private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
new Form3().Show();

}

and you have to either choose an option or exit the form to use form 2 which is the main one ?
Posted
Comments
BiteForce 17-Jul-13 17:40pm    
You could do it like this:
List<Form> forms = new List<Form>();

private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
forms.Add(new Form3());
forms.IndexOf(forms.Length-1).Show();
}

I hope I could help you.

BG
Sergey Alexandrovich Kryukov 17-Jul-13 17:46pm    
Despite the question mark, this is not a question. What's the problem?
You are using too many undefined terms. There is no such thing as "open a form", only "close". I know, it looks unreasonable, but this is what it is. There is no such thing as "exit a form". What is that?
—SA

1 solution

Are you trying to open a dialog form?
Form3 myDialog = new Form3();
myDialog.ShowDialog();
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900