Here's an example... built on an application with two buttons.
Code:
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
ChildForm newForm = new ChildForm();
newForm.Show();
}
private void button2_Click(object sender, EventArgs e)
{
ChildForm newForm = new ChildForm();
newForm.ShowDialog();
}
}
public class ChildForm : Form
{
public ChildForm()
{
}
}
Hope that helps!
Leave a comment: