Well, assuming you're reasonably skilled at winforms development, here's a simple example that I whipped up in about 10 minutes. The first for is displayed for 10 seconds, and then closes, upon which time the 2nd form opens automagically.
Step 1 - Create a new winforms app (it will already have "Form1"). I added an ok and cancel buttons to the form. but you don't have to.
Step 2 - Add a new form ("Form2").
Step 3 - In program.cs, change the main function to look like this:
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Form1 f1 = new Form1();
Application.Run(f1);
if (f1.DialogResult== DialogResult.OK)
{
Form2 f2 = new Form2();
Application.Run(f2);
f2.Activate();
}
}
Step 4 - This is your Form1 code
public partial class Form1:Form
{
int dismiss = 10000;
int elapsed = 0;
Timer timer;
public Form1()
{
InitializeComponent();
timer = new Timer(){ Interval = 50, Enabled=true };
timer.Tick += timer_Tick;
}
void timer_Tick(object sender,EventArgs e)
{
elapsed += timer.Interval;
if (elapsed >= dismiss)
{
button1.PerformClick();
}
}
private void button2_Click(object sender,EventArgs e)
{
DialogResult = DialogResult.Cancel;
this.Close();
}
private void button1_Click(object sender,EventArgs e)
{
DialogResult = DialogResult.OK;
this.Close();
}
private void Form1_FormClosing(object sender,FormClosingEventArgs e)
{
timer.Enabled = false;
timer.Dispose();
}
}
The timer might be too granular, but timer events are the lowest priority events in windows, and they are not guaranteed to be handled on a busy system. I would recommend using another technique for this, but for the purposes of example, it's suitable.