[solved] How to make my simple GUI window scrollable?
Posted: 07 Feb 2020, 03:58
Here I have a simple code of a GUI window:
Here is what it produces:
As it can be seen, some of the buttons don't fit in, which is deliberately done so in the script.
I need to make this window scrollable, that is, having the possibility of scrolling it vertically and horizontally so as to see all the controls that don't fit in the specified client area.
How could I do that?
I know that I probably have to use DllCalls like "ScrollWindow" and "SetScrollInfo", but I don't know how.
Can anyone show me, please, how to apply them to my simple code?
Code: Select all
FWC := "55a0ff" ; first window window's color
FWFS := "16" ; first window window's font size
FWFT := "Verdana" ; first window window's font
gosub, CreateFirstWindow
gosub, Go
return
CreateFirstWindow:
Gui New, hwndFW
Gui +LabelFW
Gui, % FW . ":color", % FWC
Gui, % FW . ":font", % "s" . FWFS, % FWFT
Gui, % FW . ":add", Button, , Something
Gui, % FW . ":add", Button, , Something
Gui, % FW . ":add", Button, , Something
Gui, % FW . ":add", Button, , Something
Gui, % FW . ":add", Button, , Something
Gui, % FW . ":add", Button, x+10 gFWClose , Exit
return
Go:
Gui, % FW . ":show", w220 h265, 1st window
return
FWClose:
Gui % FW . ":Default"
Gui, % FW . ":destroy"
exitapp
return
As it can be seen, some of the buttons don't fit in, which is deliberately done so in the script.
I need to make this window scrollable, that is, having the possibility of scrolling it vertically and horizontally so as to see all the controls that don't fit in the specified client area.
How could I do that?
I know that I probably have to use DllCalls like "ScrollWindow" and "SetScrollInfo", but I don't know how.
Can anyone show me, please, how to apply them to my simple code?