Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

i have a timer on a splash screen, when it's done, it is supposed to open another form...somehow, the form doesn't seem to load...the form's name is fLogin, which i declared somewhere else...

 

do u think this code is correct?

 

Private Sub Timer1_Elapsed(ByVal sender As Object, ByVal e As System.Timers.ElapsedEventArgs) Handles Timer1.Elapsed

If ProgressBar1.Value = 100 Then

Timer1.Enabled = False

fLogin.Show()

Me.Close()

Exit Sub

End If

ProgressBar1.Value = ProgressBar1.Value + 10

End Sub

Can you bind the beautiful Pleiades, and can you loose the cords of Orion? - God to Job...
Posted

VB?

 

becose in c, c# you put { } after if and without the "then", and by the way do you make the timer.Enable = true?

 

ahd why don't you put the code into a loop

 

C#

 

Timer1.Enabled = true;

ProgressBar1.Value =0;

do

{

ProgressBar1.Value = ProgressBar1.Value + 10;

}

while (ProgressBar1.Value <100);

 

Timer1.Enabled = False;

fLogin.Show();

Me.Close();

  • *Experts*
Posted

Private Sub Timer1_Elapsed(ByVal sender As Object, ByVal e As System.Timers.ElapsedEventArgs) Handles Timer1.Elapsed
If ProgressBar1.Value = 100 Then
Timer1.Enabled = False
fLogin.Show()
Me.Hide() 'change this and it should work or you can change your above line to fLogin.ShowDialog()
Exit Sub
End If
ProgressBar1.Value = ProgressBar1.Value + 10
End Sub

 

Is your splash screen your startup object? If you close the startup object your program will terminate.

 

Jon

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...