Click here to Skip to main content
15,867,756 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
VB
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
              add()
  End Sub
  Private Sub add()

      For I As Integer = 0 To 200000
          Label1.Text = I
      Next
  End Sub

For this code while the label is updating I need a popup to be displays that shows loading until the process completed can any body help how can i do that
Posted
Comments
Bernhard Hiller 16-Oct-14 4:36am    
Did you actually mean a "Splash Screen" when you said "Loading screen"?
Moses Geo 20-Oct-14 3:55am    
No,I need a Progress bar in popup. Till the above process (label1.text=i) completed

1 solution

Hello Mose, I think you need to show some progressbar on your form load using multithreading. Check the link here.
Anyway we have the quick solution for your issue. Check the below code.
VB
Private  Sub button1_Click(ByVal sender As Object, ByVal e As EventArgs)
            ShowProgress()
  End Sub

Private  Sub ShowProgress()
     For i As Integer = 0 To 2000
          label1.Text = i.ToString()
          Application.DoEvents()
     Next
End Sub
 
Share this answer
 
Comments
Moses Geo 20-Oct-14 3:59am    
Sorry I didnt get any link
NaibedyaKar 20-Oct-14 7:37am    
Just click on "here". Anyway I am providing it below.
http://www.codeproject.com/Articles/1083/Multithreaded-Programming-Using-C

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900