یه تایمر روی فرم بذارین
بعد دکمه F7 رو بزنید و کدهای زیر رو بنویسین
using System;
using System.Windows.Forms;
namespace WindowsFormsApp23
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
timer1.Interval = 1000;
timer1.Enabled = true;
timer1.Tick += new EventHandler(timer1_Tick);
timer1.Start();
}
static int counter = 0;
private void timer1_Tick(object sender, EventArgs e)
{
counter++;
if (counter == 120)
{
MessageBox.Show("Test");
}
}
}
}