Reputation: 27
I've made another form in my project, and i wanted to know how to open inside of another form? Can you please help me!
Here is the code that I've got so far:
private void optionsToolStripMenuItem_Click(object sender, EventArgs e)
{
???
}
Help me, I'm a beginner In c#
Upvotes: 0
Views: 431
Reputation: 1312
There are two options:
1:
Form2 frm2 = new Form2();
frm2.Open();
2:
Form aForm = new Form();
aForm.Text = "Title";
//Add Elements
Label l1 = new Label();
l1.Text = "Some Text";
l1.Location = new Point(10, 10);
aForm.Children.Add(l1);
//Show Form
aForm.Show();
Upvotes: 1