robsuttonjr
MIS
I have created a login form (form1) and a new form (form2). I am trying to call the new form after clicking ok button on form1 then close form1 so only form2 is shown. I am a FoxPro guy coming into the strange world of .NET. I am guessing that since form1 is the master that closing it will kill any child forms opened. So the question is how do others do this? Below is my crappy code.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace WindowsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
{
Form2 f2 = new Form2();
f2.Show();
this.Close();
}
}
private void button2_Click(object sender, EventArgs e)
{
this.Close();
}
}
}
Regards,
Rob
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace WindowsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
{
Form2 f2 = new Form2();
f2.Show();
this.Close();
}
}
private void button2_Click(object sender, EventArgs e)
{
this.Close();
}
}
}
Regards,
Rob