ممنون از دوستان . ولی منم میگم که تایمر عمل نمیکنه و دنبال دلیلش هستم. کد تایمر هم درسته چون اگر فرم Splash رو جدا استفاده کنم خیلی خوب کار میکنه.
این کدهای من برای اجرای فرم Splash هست :
این قسمت مربوط به کدهای کلاس Program.cs هست :
static class Program
{
public static LoadingForm lodingForm = null;
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo("fa-IR");
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(fals e);
lodingForm = new LoadingForm();
lodingForm.Show();
lodingForm.Refresh();
Application.Run(new MainForm());
}
}
این قسمت هم مربوط به لود فرم اصلی هست :
private void MainForm_Load(object sender, EventArgs e)
{
Program.lodingForm.Refresh();
// کدهای لود فرم اصلی
Program.lodingForm.Close();
}
و اما کدهای مربوط به فعال کردن تایمر در فرم Spalsh :
progressBarX1.PerformStep();
if (progressBar1.Value == progressBar1.Maximum)
{
timer1.Enabled = false;
this.Hide();
MainForm x = new MainForm();
x.ShowDialog();
}