Lanc1988 Posted December 9, 2003 Posted December 9, 2003 I want a splash screen for my program to make it look nice. So what I need is a code that will display it for like 3 seconds then open the main form. Also, if I need to change anything, like the startup form or something please post that I do. Thanks. Quote
Administrators PlausiblyDamp Posted December 10, 2003 Administrators Posted December 10, 2003 http://www.xtremedotnettalk.com/showthread.php?s=&threadid=77706&highlight=splash+screen Thank VolteFace for the above. also http://www.xtremedotnettalk.com/showthread.php?s=&threadid=76337&highlight=splash+screen may be worth a read Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
Lanc1988 Posted December 10, 2003 Author Posted December 10, 2003 But that first link, shows the splash screen until something is loaded. I was looking for something that is on a timer. (about 3 sec.) Quote
Administrators PlausiblyDamp Posted December 10, 2003 Administrators Posted December 10, 2003 Agreed but he also gives firstly a good way to do splash screens and suggests that forcing a user to sit and stare at a splash screen may be a bad idea, a topic also discussed in the second thread I linked to. Is there a requirement for the 3 second delay? If so you could just change VolteFace's code so instead of filling a listbox it just calls threading.Thread.CurrentThread.Sleep(3000) Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
samsmithnz Posted December 10, 2003 Posted December 10, 2003 Yeh having to wait three seconds for a splash screen to load would force me to stop using that program and find another. What is widely accepted (and I'm sure that the articles linked to above will say the same thing), is that you should display it for 3 seconds UNLESS the user clicks or presses a key. If the user really wants to read this information, it should be in the About box, which is generally the same information anyway! Quote Thanks Sam http://www.samsmith.co.nz
Lanc1988 Posted December 10, 2003 Author Posted December 10, 2003 Well.. i guess you are right, It would be nice to have it when you press a key or click the mouse it would skip it. Or maybe just make it like 2 seconds, i dunno. Quote
bpayne111 Posted December 11, 2003 Posted December 11, 2003 to do what you want to do simply add this code to your forms Load event Private Sub frmMain_Load(ByVal sender as object, ByVal e as eventargs) Me.Visible = False Dim aForm as new frmAbout() aForm.ShowDialog() Me.Visible = True End Sub 'in the About form add this code so you don't piss your users off Private Sub anything_Click(byval sender as object, e as eventargs) Handles Me.Click, lblInfo.Click, picLogo.Click 'sample control names are used Me.Close() End Sub Dim _ticks as Integer = 0 Private Sub Timer1_Tick(byval sender as object, e as eventargs) _ticks += 1 If _ticks = 3 Then Me.Close() End If 'Change the opacity little by little to make it fade away and 'look 'more professional End Sub I am creating a utility to make about forms effortless I will be posting here when it is completed. brandon Quote i'm not lazy i'm just resting before i get tired.
samsmithnz Posted December 11, 2003 Posted December 11, 2003 to do what you want to do simply add this code to your forms Load event I am creating a utility to make about forms effortless I will be posting here when it is completed. brandon They are usually effortless anyway. Quote Thanks Sam http://www.samsmith.co.nz
Lanc1988 Posted December 11, 2003 Author Posted December 11, 2003 Put it in the about form? Or the form that has the splash screen? Quote
Lanc1988 Posted December 11, 2003 Author Posted December 11, 2003 Oh nevermind, you mean the about form as in the 'splash screen' form. right? Quote
R4PM0NK3Y Posted December 12, 2003 Posted December 12, 2003 This is what I do for my splash screens, and it works every time. I think it's fairly simple and to the point. 'Insert a new module into your form (Project > Add Module...) 'Use this code for the module (Note that you must change your startup object to Sub Main() Sub Main() Dim Splash As New frmSplash 'Where frmSplash is your splash screen form name Dim MainForm As New frmMain 'Where frmMain is your main program form name Splash.ShowDialog() MainForm.ShowDialog() End Sub 'Now go to your splash screen and use this code (you must add a new Timer Object to your splash screen form Private Sub frmSplash_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load SplashTimer.Interval = 3000 'Set timer interval to 3 seconds SplashTimer.Enabled = True 'Enable timer End Sub 'Code for splash screen timer Private Sub SplashTimer_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SplashTimer.Tick Me.Close() 'Close splash screen form, your main form will now load End Sub Hope that helps. :) Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.