hamidebrahimi
New Member
سلام من میخوام توی برنامه #c دوتا فرم ایجاد کنم که فرم اولی بعد چند ثانیه با استفاده از تایمر بسته بشه و فرم شماره دو باز بشه چیکار کنم هرکی بلده کمکم کنه
سلام من میخوام توی برنامه #c دوتا فرم ایجاد کنم که فرم اولی بعد چند ثانیه با استفاده از تایمر بسته بشه و فرم شماره دو باز بشه چیکار کنم هرکی بلده کمکم کنه
[COLOR="#D3D3D3"] public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
[/COLOR] var t = new Timer();
t.Tick += new EventHandler(CloseForm);
t.Interval = [B][SIZE=3][COLOR="#0000FF"]4[/COLOR][/SIZE][/B] * 1000; //4 Seconds
t.Enabled = true;
[COLOR="#D3D3D3"] }
[/COLOR]
void CloseForm(object sender, EventArgs e)
{
Close();
}
[COLOR="#D3D3D3"] }
[/COLOR]
[COLOR="#D3D3D3"] static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);[/COLOR]
Application.Run(new [B][COLOR="#0000FF"]Form1[/COLOR][/B]());
[COLOR="#D3D3D3"] }[/COLOR]
[COLOR="#D3D3D3"] static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);[/COLOR]
Application.Run(new [B][COLOR="#0000FF"]Form1[/COLOR][/B]());
[SIZE=3]Application.Run(new [B][COLOR="#0000FF"]Form2[/COLOR][/B]());[/SIZE]
[COLOR="#D3D3D3"] }[/COLOR]