Sign in to follow this  
Followers 0
sulfurious

Can Progress Bar be docked to child window?

3 posts in this topic

If you have a window, and a child window within that window, can you 'dock' a progress bar into either of the two? Preferably the child? The progress bar let's you put in x & y, but

a. how do you find the left and top of the window/child without using coord mode

b. if you moved window/child, how do you call the progress bar without recreating it

Inquiring minds want to know :)

later,

Sul

Share this post


Link to post
Share on other sites



Excellent !!! Here is how I am using it.

#include <GUIConstants.au3>

Opt("GUIOnEventMode", 1)
Opt("WinSearchChildren",1)
$mg = GUICreate("My GUI",500,500)
GUISetState()
GUISetOnEvent($GUI_EVENT_CLOSE, "_EXIT")
$but1 = GUICtrlCreateButton("button1",20,20,50,30)
GUICtrlSetOnEvent($but1,"_somefunc1")
$but2 = GUICtrlCreateButton("button2",100,20,50,30)
GUICtrlSetOnEvent($but2,"_somefunc2")
$child = GUICreate("child",300,100,30,150,$WS_POPUP,$WS_EX_MDICHILD,$mg)
GUISetState()

ProgressOn("Progress", "", "", -1, -1,17)
While 1
    $size = WinGetPos("child")
    WinMove("Progress", "", $size[0], $size[1])
    Sleep(20)
WEnd

Sleep(2000)
While 1
    Sleep(1000)  ; Idle around
WEnd

Func _somefunc1()
    $a = 0
    do
        $a = $a + 10
        ProgressSet($a,$a & " percent","doing stuff")
        Sleep(500)
    Until $a = 100
    ProgressSet(""," ","")
EndFunc

Func _somefunc2()
    MsgBox(4096,"function","do more stuff")
EndFunc

Func _EXIT()
    Exit
EndFunc

Thanks for the tip,

Sul

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