how to attach a slider to a progress bar Topic is solved

Get help with using AutoHotkey and its commands and hotkeys
ystin
Posts: 2
Joined: 04 Jun 2020, 10:33

how to attach a slider to a progress bar

04 Jun 2020, 10:46

help me find out how to link the progress bar to the slider slider and whether this is possible. I need the value of the progress bar to change when I move the slider slider
User avatar
Alguimist
Posts: 369
Joined: 05 Oct 2015, 16:41
Contact:

Re: how to attach a slider to a progress bar  Topic is solved

04 Jun 2020, 11:47

The following code does what you ask:

Code: Select all

#SingleInstance Force
#NoEnv
SetWorkingDir %A_ScriptDir%
SetBatchLines -1

Global hPrg, Sldr

Gui Add, Progress, hWndhPrg x42 y33 w377 h20 -Smooth, 0
Gui Add, Slider, vSldr gSetProgress x42 y79 w377 h32 +AltSubmit, 0

Gui Show, w461 h146, Progress Indicator
Return

GuiEscape:
GuiClose:
    ExitApp

SetProgress() {
    Gui Submit, NoHide
    GuiControl,, %hPrg%, %Sldr%
}
teadrinker
Posts: 1716
Joined: 29 Mar 2015, 09:41
Contact:

Re: how to attach a slider to a progress bar

04 Jun 2020, 13:12

Gui Submit, NoHide is unnecessary here.
User avatar
Alguimist
Posts: 369
Joined: 05 Oct 2015, 16:41
Contact:

Re: how to attach a slider to a progress bar

04 Jun 2020, 13:23

True.
The position is also stored in the output variable whenever the control's g-label is launched.
ystin
Posts: 2
Joined: 04 Jun 2020, 10:33

Re: how to attach a slider to a progress bar

05 Jun 2020, 01:47

Alguimist wrote:
04 Jun 2020, 11:47
The following code does what you ask:

Code: Select all

#SingleInstance Force
#NoEnv
SetWorkingDir %A_ScriptDir%
SetBatchLines -1

Global hPrg, Sldr

Gui Add, Progress, hWndhPrg x42 y33 w377 h20 -Smooth, 0
Gui Add, Slider, vSldr gSetProgress x42 y79 w377 h32 +AltSubmit, 0

Gui Show, w461 h146, Progress Indicator
Return

GuiEscape:
GuiClose:
    ExitApp

SetProgress() {
    Gui Submit, NoHide
    GuiControl,, %hPrg%, %Sldr%
}

Return to “Ask For Help”

Who is online

Users browsing this forum: boiler, Google [Bot], honarjoo, ktfroy, randysejas, Toruk and 62 guests