You can't close Form1 & start Form2 after it unless you have third window opened.
Just make Form2 invisible for 5 seconds then use Me.Hide on Form1.
bro i want to make hide form1 not form2 wtf..
form1 hide or close...anywhere after 5 sec and appear form2 how is the code?
How about learning the language and reading about classes and functions on the Microsoft website instead of coming to a forum and asking for full sources :|
Originally Posted by elitecs
bro i want to make hide form1 not form2 wtf..
form1 hide or close...anywhere after 5 sec and appear form2 how is the code?
Learn English & VB.NET languages before asking for help.
Yup you guys right
he didn't read the Rules ?
Threading.Thread.Sleep(5000)
Form2.ShowDialog
How about explaining it instead of just feeding him? The compromised solution
I don't know VB so this is converted from C# so it may not be accurate. No copy paste for you though.
vb handles Forms differently...it will create an instance for you with the same name as the class (?). Checking now if New Form2() will automatically .Show(), but I don't think so.
edit:
Code:
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim xx As New Form2()
End Sub
^^Form 2 doesn't get displayed automatically
Originally Posted by Smasherx74
Threading.Thread.Sleep(5000)
Form2.ShowDialog
Calling Thread.Sleep() inside Form1_Load() will cause the form not to be displayed until after the sleep. I think OP is using this like a "splash screen", and it not showing up would defeat the purpose. And you forgot to hide Form1 : p
Originally Posted by abuckau907
I'm pretty sure simply calling New Form2() won't show the form (Show() or ShowDialog()). At least in vb. Checking now..
I think OP doesn't speak English..so explaining anything is a losing battle.
Code:
Threading.Thread.Sleep(5000)
Form2.Show()
Me.Close() '' if this causes the application to close, try Me.Visible = false (Me.Hide()?) , instead.
I'm pretty sure it does in C#, I have no idea about VB. It would just be one more line if it doesn't automatically show in VB wouldn't it?
yep. in your example, form2.Show()
or, because vb will create an instance for you..no need to use New, simply
Form2.Show() or Form2.ShowDialog()
(edit: lol I didn't see you had replied yet and edited my previous post..removed the 'losing battle' comment, but I guess now it can stay : p )
I think Visual Studio had a Splash Screen template.. I don't know if it still has