4 Replies - 1377 Views - Last Post: 25 November 2009 - 11:52 PM Rate Topic: -----

#1 tushar149   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 25-November 09

Progress Bar problem

Post icon  Posted 25 November 2009 - 08:47 AM

Hi

I am building one login form and after that I am displaying main form after that. My main form takes time to load so i would like to display progress bar. What I did is i have cerated new form with progress bar in it and changed the style to Marquee.

My problem is after logging in (i.e. before main form gets displayed) progress bar form gets displayed which is correct but it doesn't display progress bar in it instead of that it displays white screen on progress bar area.

I don't know how to tackle this problem.

Can somebody please help!!!!!!

Is This A Good Question/Topic? 0
  • +

Replies To: Progress Bar problem

#2 bigbug   User is offline

  • D.I.C Head

Reputation: 6
  • View blog
  • Posts: 97
  • Joined: 27-October 09

Re: Progress Bar problem

Posted 25 November 2009 - 09:04 AM

You got any code to show us?
Was This Post Helpful? 0
  • +
  • -

#3 sharpy   User is offline

  • D.I.C Regular
  • member icon

Reputation: 38
  • View blog
  • Posts: 396
  • Joined: 02-June 07

Re: Progress Bar problem

Posted 25 November 2009 - 01:07 PM

Hi

Not sure if this is what you want as you did not post any code but it may help. This is the code I use within a splash screen but I'm sure you can adapt it to suit. Load 2 timers to your form from the toolbox.




Public Class Splash

	Private Sub Splash_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
		Timer2.Start()
		Timer1.Start()
	End Sub

	Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick


		If (Me.ProgressBar1.Value < 100) Then
			Me.ProgressBar1.Value += 5
		   
		End If

		If (Me.ProgressBar1.Value = 100) Then

			Form1.Show()
			Me.Hide()
		End If
	End Sub
	Private Sub Timer2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer2.Tick
		Label2.Visible = True
		ProgressBar1.Visible = True
	End Sub

   
End Class


Hope it helps
Was This Post Helpful? 0
  • +
  • -

#4 tushar149   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 25-November 09

Re: Progress Bar problem

Posted 25 November 2009 - 11:42 PM

View Postsharpy, on 25 Nov, 2009 - 12:07 PM, said:

Hi

Not sure if this is what you want as you did not post any code but it may help. This is the code I use within a splash screen but I'm sure you can adapt it to suit. Load 2 timers to your form from the toolbox.




Public Class Splash

	Private Sub Splash_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
		Timer2.Start()
		Timer1.Start()
	End Sub

	Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick


		If (Me.ProgressBar1.Value < 100) Then
			Me.ProgressBar1.Value += 5
		   
		End If

		If (Me.ProgressBar1.Value = 100) Then

			Form1.Show()
			Me.Hide()
		End If
	End Sub
	Private Sub Timer2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer2.Tick
		Label2.Visible = True
		ProgressBar1.Visible = True
	End Sub

   
End Class


Hope it helps



Hi

Thank you very much for reply.

THe code which you have posted above would be helpful if i have got progress bar is on the same form.

BUt in my case firstly i am loading login form and after that I have got another form on the load of which I am calling progress bar form .

So just to simply things i will give you name of the form

1) Login.vb
2) frmprogress.vb
3) Frmmain.vb


So the moment I am logged in progress bar form gets displayed and I am calling this progress bar form in the load of Frmmain form. I have got one SQL in the load of Frmmain which takes time so that is the reason i want to display progress bar form.

Hope this helps....
Was This Post Helpful? 0
  • +
  • -

#5 sharpy   User is offline

  • D.I.C Regular
  • member icon

Reputation: 38
  • View blog
  • Posts: 396
  • Joined: 02-June 07

Re: Progress Bar problem

Posted 25 November 2009 - 11:52 PM

Hi

Well the login form would be your start form which you would set in the projects properties so once logged in you would say within that forms code

frmprogress.show


then in the frmprogress which would contain my code you would say

frmmain.show


I use this code as I am also loading a database in my frmmain

Post your code it would help

This post has been edited by sharpy: 26 November 2009 - 12:49 AM

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1