Sign in to follow this  
Followers 0
Khryus

Embedding a ProgressBar in a StatusBar

3 posts in this topic

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

 

Share this post


Link to post
Share on other sites



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?


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

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

 

Share this post


Link to post
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
Sign in to follow this  
Followers 0