Jump to content

Embedding a ProgressBar in a StatusBar


Khryus
 Share

Recommended Posts

Hi, I was trying to embed a progressbar inside a statusbar. I took some code snippets from the help file, and got this:

$StatusBar1 = _GUICtrlStatusBar_Create($Form1_1)
$Progress1 = GUICtrlCreateProgress(0, 0, -1, -1)
_GUICtrlStatusBar_SetBkColor($StatusBar1, 0x808080)
_GUICtrlStatusBar_SetMinHeight($StatusBar1, 20)
Local $aParts[2] = [570, 98]
_GUICtrlStatusBar_SetParts($StatusBar1, $aParts)
_GUICtrlStatusBar_EmbedControl($StatusBar1, 2, $Progress1, 4)

When I run the script, it throws out this error:

C:\Program Files (x86)\AutoIt3\Include\GuiStatusBar.au3 (257) : ==> Subscript used with non-Array variable.:

Local $iBarX = $aRect[0]

Local $iBarX = $aRect^ ERROR

Using these:

#include <Array.au3>
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <GUIListBox.au3>
#include <GuiStatusBar.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <ProgressConstants.au3>
#include <SendMessage.au3>
Opt("GUIOnEventMode", 1)

Did I do something wrong?

"The story of a blade is linked in Blood." 

―Yasuo

 

Link to comment
Share on other sites

  • Moderators

Hi, megablox. The error states that you're trying to read from $aRect[0] when this field does not exist. Can you please post your entire code, so we can see where you're interacting with $aRect?

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

Problem solved! I called

_GUICtrlStatusBar_EmbedControl($StatusBar1, 2, $Progress1, 4)

wrongly, fixed by changing 2 to 1 :P

@JLogan3o13 , I fixed, thanks for helping though! ^^

Edited by megablox

"The story of a blade is linked in Blood." 

―Yasuo

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...