How to calculate form loading time
-
Hi I have created a splash screen on my own i want my original screen to be appear completely before the splash screen vanishes ....please if any one knows how to calculate the loading time of the form then please do let me know this is my code for the splash screen >>> Timer is calling this function .....so its the starting form of mine private void check(object sender, EventArgs e) { if (i < 1 && status == true) { this.Opacity = i; i = i + 0.1; if (i > 0.9) { status = false; } } else if (status == false) { this.Opacity = i; i = i - 0.1; } if (i < 0.1) { timer1.Stop(); this.Hide(); printsoftwareparent psf = new printsoftwareparent(); psf.Show(); } }
its me sid
I suspect you can calculate form loading time only approximately if you can at all so instead I suggest that the main form signals splash screen form when finishes initialization.
#region signature my articles #endregion
-
I suspect you can calculate form loading time only approximately if you can at all so instead I suggest that the main form signals splash screen form when finishes initialization.
#region signature my articles #endregion
hi thanks for ur reply I want the application to be started like Acrobat Reader or PhotoShop If u know how to do this then please do let me know
its me sid
-
Hi I have created a splash screen on my own i want my original screen to be appear completely before the splash screen vanishes ....please if any one knows how to calculate the loading time of the form then please do let me know this is my code for the splash screen >>> Timer is calling this function .....so its the starting form of mine private void check(object sender, EventArgs e) { if (i < 1 && status == true) { this.Opacity = i; i = i + 0.1; if (i > 0.9) { status = false; } } else if (status == false) { this.Opacity = i; i = i - 0.1; } if (i < 0.1) { timer1.Stop(); this.Hide(); printsoftwareparent psf = new printsoftwareparent(); psf.Show(); } }
its me sid
Maybe not a very good way of doing it, but how about getting DateTime.Now when your app starts, and DateTime.Now when it's finished loading, calculate the difference. Should give you a fairly accurate time.
He who makes a beast out of himself gets rid of the pain of being a man
-
Maybe not a very good way of doing it, but how about getting DateTime.Now when your app starts, and DateTime.Now when it's finished loading, calculate the difference. Should give you a fairly accurate time.
He who makes a beast out of himself gets rid of the pain of being a man
He is interested in knowing load time before the application has loaded.
#region signature my articles #endregion
-
Hi I have created a splash screen on my own i want my original screen to be appear completely before the splash screen vanishes ....please if any one knows how to calculate the loading time of the form then please do let me know this is my code for the splash screen >>> Timer is calling this function .....so its the starting form of mine private void check(object sender, EventArgs e) { if (i < 1 && status == true) { this.Opacity = i; i = i + 0.1; if (i > 0.9) { status = false; } } else if (status == false) { this.Opacity = i; i = i - 0.1; } if (i < 0.1) { timer1.Stop(); this.Hide(); printsoftwareparent psf = new printsoftwareparent(); psf.Show(); } }
its me sid
insert a timer in your form and enable it after all code in Form Load event, like:
private void Form1_Load(object sender, EventArgs e)
{
// code if any
timer1.Enabled = true;
}then in timer1_Tick event, show your splash screen. if you want to delay in showing splash screen then just increase the timer1 interval NOTE: Do not forget to disable timer, you can disable it in timer1_tick event.
private void timer1_tick(object sender, EventArgs e)
{
timer1.Enabled = false;
// splash screen code
}hope it will help.
Becoming Programmer...
-
hi thanks for ur reply I want the application to be started like Acrobat Reader or PhotoShop If u know how to do this then please do let me know
its me sid
You can start other applications using Process class but I don't think you will be able to estimate their load time.
#region signature my articles #endregion
-
insert a timer in your form and enable it after all code in Form Load event, like:
private void Form1_Load(object sender, EventArgs e)
{
// code if any
timer1.Enabled = true;
}then in timer1_Tick event, show your splash screen. if you want to delay in showing splash screen then just increase the timer1 interval NOTE: Do not forget to disable timer, you can disable it in timer1_tick event.
private void timer1_tick(object sender, EventArgs e)
{
timer1.Enabled = false;
// splash screen code
}hope it will help.
Becoming Programmer...
Thanks for the suggestions ...in mean time i have done something its working satisfactory but not as i expected private void check(object sender, EventArgs e) { if (i < 1 && stat== true) { this.Opacity = i; i = i + 0.1; if (i > 0.9) { stat = false; printsoftwareparent psp = new printsoftwareparent(); psp.Show(); this.BringToFront(); } } else if (stat == false) { this.Opacity = i; i = i - 0.1; } if (i < 0.1) { timer1.Stop(); this.Hide(); } }
its me sid
-
Thanks for the suggestions ...in mean time i have done something its working satisfactory but not as i expected private void check(object sender, EventArgs e) { if (i < 1 && stat== true) { this.Opacity = i; i = i + 0.1; if (i > 0.9) { stat = false; printsoftwareparent psp = new printsoftwareparent(); psp.Show(); this.BringToFront(); } } else if (stat == false) { this.Opacity = i; i = i - 0.1; } if (i < 0.1) { timer1.Stop(); this.Hide(); } }
its me sid
you have said that you want to show splash screen just like Acrobat Reader that mean the splash screen should show after the Form1. as i read your code, you are trying to show Splash screen as fading but you doing little wrong, read my previous post carefully that will help you
Becoming Programmer...
-
you have said that you want to show splash screen just like Acrobat Reader that mean the splash screen should show after the Form1. as i read your code, you are trying to show Splash screen as fading but you doing little wrong, read my previous post carefully that will help you
Becoming Programmer...
I would like to clear...what i said Firstly the splash screen comes and in the background the software parent form gets loaded as the form screen disappears with in no time the parent form must appear splash screen is shown to hide the slow loading of the parent form i hope i am clear regards sindhu tiwari:rose:
its me sid
-
Hi I have created a splash screen on my own i want my original screen to be appear completely before the splash screen vanishes ....please if any one knows how to calculate the loading time of the form then please do let me know this is my code for the splash screen >>> Timer is calling this function .....so its the starting form of mine private void check(object sender, EventArgs e) { if (i < 1 && status == true) { this.Opacity = i; i = i + 0.1; if (i > 0.9) { status = false; } } else if (status == false) { this.Opacity = i; i = i - 0.1; } if (i < 0.1) { timer1.Stop(); this.Hide(); printsoftwareparent psf = new printsoftwareparent(); psf.Show(); } }
its me sid
TRY THIS !!!! in timer properties..set Enabled to true and interval to 1 private void SplashScreen_Load(object sender, EventArgs e) { timer.Enabled = false; this.Opacity = 0; } private void timer_Tick(object sender, EventArgs e) { if (Splash > 2) { timer.Enabled = false; this.Hide(); frmLogin Login = new frmLogin(); Login.Show(); } else { Splash += 0.01; this.Opacity = Splash; } }