Progress bar like a dialog box ?

A

Agnes

as the form process some cacluation , How can I show the progress bar in a
daliog box (prompt out )??
as the process is completed, the dailog box will be closed .
Will it make the program slow ??
thanks
 
W

William Ryan eMVP

You can just create a Form with a Progress bar on it. Create a public
property on it so you can call it from the first form and reference it
accordingly - calling ShowDialog(); Probably better off using events if
possible.

In and of itself it won't make your program slow but it all depends on how
you code it.

--
W.G. Ryan MVP Windows - Embedded

Have an opinion on the effectiveness of Microsoft Embedded newsgroups?
Let Microsoft know!
https://www.windowsembeddedeval.com/community/newsgroups
 
C

Cor Ligthert

Agnes,

I saw this question a lot of times before and thought why are the answers
always that difficult, I made a simple sample bellow. You have to make that
form2 of course to your shape, it is as simple as possible.

I hope this helps?

Cor

\\\2 forms with a progressbar on form2
Private frm As New Form2
Private Sub Form1_Load(ByVal sender As Object, _
ByVal e As System.EventArgs) Handles MyBase.Load
Me.Timer1 = New Timer(components)
Me.Timer1.Enabled = True
Me.Timer1.Interval = 1000
Me.frm.Show()
frm.ProgressBar1.Maximum = 100
frm.ProgressBar1.Step = 25
End Sub
Private Sub Timer1_Tick(ByVal sender As Object, _
ByVal e As System.EventArgs) Handles Timer1.Tick
frm.Refresh()
frm.ProgressBar1.PerformStep()
frm.BringToFront()
If frm.ProgressBar1.Value > 99 Then
Timer1.Enabled = False
MessageBox.Show("I am there")
frm.Close()
End If
End Sub
///
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top