Simple progress bar

G

Guest

Hi. How can I insert a simple progress bar in my form. I have a form that
takes a lot to load, and I would like to put a progress bar so users could
see that the form is loading and the computer is not stopped. :)

Any idea how to do this?

Regards,
Marco
 
G

Guest

Hi Daniel.

I went to the granite site and I tried to use this code, but in witch event
do I use this code, any idea?

Dim intCurrentProgress As Integer
' This is the number of objects you expect to count which take some
' time to process. It likely won't be a constant in your environment.
Dim intTotalWidth As Integer
Const intProgressBarMax As Integer = 20000

intTotalWidth = Me.boxProgressBar.Width

For intCurrentProgress = 1 To intProgressBarMax
Me.rectProgressBar.Width = (intTotalWidth / intProgressBarMax) *
intCurrentProgress
Me.Repaint
Next intCurrentProgress

Marco
 
P

Perry

Add two labels to yr form
Label1 (progress front backcolor: some blue)
Label2 (progress backcolor: white; width according to yr design)
(position Label1 inside Label2)
whereby [rs] is an instantiated recordset object variable.

Dim iMax as integer, iCnt as integer
iCnt =1
iMax = rs.RecordCount
Do Until rs.EOF
'Do some stuff with records
Me.Label1.width = me.Label2.width * (iCnt / iMax)
me.Repaint
rs.MoveNext
Loop

Krgrds,
Perry
 
G

Guest

Hi Perry.

There's one problem. I don't use recorset connection type. I use control
source.
:)

The code I wrote, that was on garny site, it looks good, I just don't know
where to use.

Marco

Perry said:
Add two labels to yr form
Label1 (progress front backcolor: some blue)
Label2 (progress backcolor: white; width according to yr design)
(position Label1 inside Label2)
whereby [rs] is an instantiated recordset object variable.

Dim iMax as integer, iCnt as integer
iCnt =1
iMax = rs.RecordCount
Do Until rs.EOF
'Do some stuff with records
Me.Label1.width = me.Label2.width * (iCnt / iMax)
me.Repaint
rs.MoveNext
Loop

Krgrds,
Perry

Marco said:
Hi. How can I insert a simple progress bar in my form. I have a form that
takes a lot to load, and I would like to put a progress bar so users could
see that the form is loading and the computer is not stopped. :)

Any idea how to do this?

Regards,
Marco
 
P

Perry

You can use it within any measurable iteration during code execution ...
Hmm, now I had a hard time putting the above line "on paper", but I think it
covers it ...
:)

Krgrds,
Perry

Marco said:
Hi Perry.

There's one problem. I don't use recorset connection type. I use control
source.
:)

The code I wrote, that was on garny site, it looks good, I just don't know
where to use.

Marco

Perry said:
Add two labels to yr form
Label1 (progress front backcolor: some blue)
Label2 (progress backcolor: white; width according to yr design)
(position Label1 inside Label2)
whereby [rs] is an instantiated recordset object variable.

Dim iMax as integer, iCnt as integer
iCnt =1
iMax = rs.RecordCount
Do Until rs.EOF
'Do some stuff with records
Me.Label1.width = me.Label2.width * (iCnt / iMax)
me.Repaint
rs.MoveNext
Loop

Krgrds,
Perry

Marco said:
Hi. How can I insert a simple progress bar in my form. I have a form
that
takes a lot to load, and I would like to put a progress bar so users
could
see that the form is loading and the computer is not stopped. :)

Any idea how to do this?

Regards,
Marco
 
G

Guest

Hello. Can you give me anexample??

Regards,
Marco

Perry said:
You can use it within any measurable iteration during code execution ...
Hmm, now I had a hard time putting the above line "on paper", but I think it
covers it ...
:)

Krgrds,
Perry

Marco said:
Hi Perry.

There's one problem. I don't use recorset connection type. I use control
source.
:)

The code I wrote, that was on garny site, it looks good, I just don't know
where to use.

Marco

Perry said:
Add two labels to yr form
Label1 (progress front backcolor: some blue)
Label2 (progress backcolor: white; width according to yr design)
(position Label1 inside Label2)
whereby [rs] is an instantiated recordset object variable.

Dim iMax as integer, iCnt as integer
iCnt =1
iMax = rs.RecordCount
Do Until rs.EOF
'Do some stuff with records
Me.Label1.width = me.Label2.width * (iCnt / iMax)
me.Repaint
rs.MoveNext
Loop

Krgrds,
Perry

"Marco" <[email protected]> schreef in bericht
Hi. How can I insert a simple progress bar in my form. I have a form
that
takes a lot to load, and I would like to put a progress bar so users
could
see that the form is loading and the computer is not stopped. :)

Any idea how to do this?

Regards,
Marco
 
P

Perry

Hello. Can you give me anexample??

Your situation:
You have a "simple" progressbar coded in some form.
You don't know how to use this.

My answers:
My initial contribution to this thread:
example with some code for a "simple" progressbar utilised in a recordset
looping/iterating scenario.

Am I missing something?

Krgrds,
Perry

Marco said:
Hello. Can you give me anexample??

Regards,
Marco

Perry said:
You can use it within any measurable iteration during code execution ...
Hmm, now I had a hard time putting the above line "on paper", but I think
it
covers it ...
:)

Krgrds,
Perry

Marco said:
Hi Perry.

There's one problem. I don't use recorset connection type. I use
control
source.
:)

The code I wrote, that was on garny site, it looks good, I just don't
know
where to use.

Marco

:

Add two labels to yr form
Label1 (progress front backcolor: some blue)
Label2 (progress backcolor: white; width according to yr design)
(position Label1 inside Label2)
whereby [rs] is an instantiated recordset object variable.

Dim iMax as integer, iCnt as integer
iCnt =1
iMax = rs.RecordCount
Do Until rs.EOF
'Do some stuff with records
Me.Label1.width = me.Label2.width * (iCnt / iMax)
me.Repaint
rs.MoveNext
Loop

Krgrds,
Perry

"Marco" <[email protected]> schreef in bericht
Hi. How can I insert a simple progress bar in my form. I have a form
that
takes a lot to load, and I would like to put a progress bar so users
could
see that the form is loading and the computer is not stopped. :)

Any idea how to do this?

Regards,
Marco
 

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

Similar Threads

Progress Bar for Form Loading 5
Strange progress bar behavior ! 3
Progress Bar 4
Excel Progress Bar Showing Progress of Month 0
Progress Bar 1
Progress Bar 1
Progress bar shows on next record 2
Progress Bar..how? 1

Top