Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Simulation of instalation progress Word- VBA (progressbar) 1

Status
Not open for further replies.

sicilpol

Technical User
Jul 26, 2007
3
PL
decided to write here for a help

I need to create simulazione of instalation program to burn CD (As nero)

I need to create 2 progress bar

4 labels

1 pulsant button (command)

and join them in this way:

1. ulsant button has to move progress bars one from 0-1000 second from 1000-0

2. EWvery bar has to have own label with percentuale status of progress

3. One label has to report percentual progress of data delay (how much stayed) from 1 to 10000000

4. One label has to be static and has to be written: "instalation" or "burning"



I already started, butnothing works :(

Beside adding graphic thisng (labels, button, bars) I wrote 2codes:

For one bar:

Dim x As Long
Dim y As Long
Dim z As Long
y = 10
ProgressBar1.Value = 0
For x = 1 To 10
z = x * y
For s = 0 To 1000
Next s
ProgressBar1.Value = z
Next x

Then to second bar:

Dim x As Long
Dim y As Long
Dim z As Long
y = 10
ProgressBar1.Value = 0
For x = 1 To 10
z = x * y
For s = 1000 To 0
Next s
ProgressBar1.Value = z
Next x

but they do not work :(

i wrote them into command pulsant, i did ok?

Can anyone help me?

Ps. Sorry for my terriblr language
 
I hope you have ProgressBar1's .MaxValue and .MinValue defined in Properties, but:

Code:
Dim x As Long
Dim y As Long
Dim z As Long

y = 10

ProgressBar1.Value = 0

For x = 1 To 10
   z = x * y
   For [red]s[/red] = 0 To 1000
      [green]'s is not defined[/green]
      [green]'This For Next loop does not do anything[/green]
   Next [red]s[/red]
   ProgressBar1.Value = z
Next x

And where is this code? In Form_Load?


Have fun.

---- Andy
 
I simply make this:
created for now microsoft office progressbar6
than created comand button and put this code
Dim x As Long
Dim y As Long
Dim z As Long
y = 10
ProgressBar1.Value = 0
For x = 1 To 10
z = x * y
For s = 0 To 1000
Next s
ProgressBar1.Value = z
Next x


this worked
now, what to do, to put into the same second command for next progressbar that will move from 1000 to 0?
 

Why do you have this loop;
Code:
For s = 0 To 1000
Next s
???

Have fun.

---- Andy
 
progressbar6 ???

If you have a ProgressBar2 that you want to go the other way, how about this:

Code:
Dim x As Long

ProgressBar1.Value = 0
[blue]ProgressBar2.Value = 100[/blue]

For x = 1 To 100
    ProgressBar1.Value = x
    [blue]ProgressBar2.Value = x - 100[/blue]
Next x

Have fun.

---- Andy
 

Ooops,
Code:
[blue]ProgressBar2.Value = 100 - x[/blue]

Have fun.

---- Andy
 
thanks :D

thanks to one person, i chenged:

Dim ile As Integer
Dim k As Long
UserForm1.Caption = "Attenzione: installazione in corso."

For ile = 0 To 1000
UserForm1.Repaint
'delay
For k = 1 To 10000000
Next k

ProgressBar1.Value = ile
Label1 = Int(ile / 10) & " %"
ProgressBar2.Value = 1000 - ile
Label2 = 100 - Int(ile / 10) & " %"
DoEvents
Next ile
UserForm1.Caption = "Installazione completata."

but thank you for care!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top