# GUICtrlCreateProgress.

## Recommended Posts

# MY LOVE FOR YOU... IS LIKE A TRUCK- #

##### Share on other sites

What's so difficult about it that you need an example to understand? Setting the value of a progress bar is basic math: Take however many units you've completed so far, divide it by the total number of units that you're working on, multiply by 100 and round it off. It's always the same calculations no matter what you're tracking the progress of. The help file has an example under GUICtrlCreateProgress, and an example of downloading a file in the background (thus allowing you to check its progress) can be found under InetGet.

##### Share on other sites

I suck at maths, What you just said, confused me.

# MY LOVE FOR YOU... IS LIKE A TRUCK- #

##### Share on other sites

The calculation is this: GUICtrlSetData(\$progressbar, Round((\$X/\$Y)*100))

Where \$X is the number of "things" (lines, files, bytes, or whatever) that you've finished so far, and \$Y is the total number of "things" that you're doing. Make sense?

##### Share on other sites

Kinda. But still confused

# MY LOVE FOR YOU... IS LIKE A TRUCK- #

##### Share on other sites

Kinda. But still confused

Confused? I thought sokko explained it wonderfully.
```Local \$ItemsFinished = 0, \$TotalItemsToDo = 30, \$CompletionPercentage = 100

For \$iCountDown = \$ItemsFinished To \$TotalItemsToDo
ToolTip('You are Currently ' & Int((\$iCountDown / \$TotalItemsToDo) * \$CompletionPercentage) & '% Done.' _
& @CR & 'Current Items Finished are: ' & \$iCountDown, 0, 0)
Sleep(500)
Next```
No pecentage bar example of what's going on basically.

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

##### Share on other sites

```\$size = InetGetSize("file")
\$kb = Round(\$size / 1024)

While @InetGetActive
\$p = (100 * @InetGetBytesRead) / \$size
ProgressSet(\$p, \$kbi & "/" & \$kb & " kilobytes", "Download in progress.")
Sleep(130)
WEnd
ProgressOff()```

Edited by Somniis

##### Share on other sites

```\$size = InetGetSize("file")
\$kb = Round(\$size / 1024)

While @InetGetActive
\$p = (100 * @InetGetBytesRead) / \$size
ProgressSet(\$p, \$kbi & "/" & \$kb & " kilobytes", "Download in progress.")
Sleep(130)
WEnd
ProgressOff()```

Needed an example, using GUICtrlCreateProgress

# MY LOVE FOR YOU... IS LIKE A TRUCK- #

##### Share on other sites

Needed an example, using GUICtrlCreateProgress

What's wrong with the example in the help file?

[font="Tahoma"]"Tougher than the toughies and smarter than the smarties"[/font]

##### Share on other sites

It confuses me.

# MY LOVE FOR YOU... IS LIKE A TRUCK- #

##### Share on other sites

It confuses me.

Why don't you post what about it confuses you step by step, so you an be unconfused. You said in another thread, that the PixelSearch() confused you too, if the help file is confusing you, maybe it's confusing others too, and maybe it should be put in more lamens terms if it isn't already.

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

## Create an account

Register a new account

×

• Wiki

• Back

• #### Beta

• Git
• FAQ
• Our Picks
×
• Create New...