Gui & scroll bars

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
just me
Posts: 9453
Joined: 02 Oct 2013, 08:51
Location: Germany

Gui & scroll bars

17 Feb 2015, 12:19

Code: Select all

		// MSDN: "The AdjustWindowRectEx function does not take the WS_VSCROLL or WS_HSCROLL styles into
		// account. To account for the scroll bars, call the GetSystemMetrics function with SM_CXVSCROLL
		// or SM_CYHSCROLL."
		if (style & WS_HSCROLL)
			width += GetSystemMetrics(SM_CXHSCROLL);
		if (style & WS_VSCROLL)
			height += GetSystemMetrics(SM_CYVSCROLL);
I'm wondering why the width of the Gui is increased for WS_HSCROLL and the height for WS_VSCROLL. Is this really intended, and if so, why?

Also, there's a discrepancy between the comment and the code.
MJs
Posts: 454
Joined: 23 Sep 2014, 03:29

Re: Gui & scroll bars

17 Feb 2015, 15:15

I believe that:
- a horizontal scroll bar means the width needs to increase to eliminate the need for it
- a vertical scroll bar means the height needs to increase to eliminate the need for it
just me
Posts: 9453
Joined: 02 Oct 2013, 08:51
Location: Germany

Re: Gui & scroll bars

18 Feb 2015, 04:38

The only reason for using WS_HSCROLL/WS_VSCROLL is that you want to show scroll bars.
User avatar
ScottMeyer
Posts: 33
Joined: 27 Sep 2017, 12:52
Contact:

Re: Gui & scroll bars

28 Oct 2017, 08:11

Hi,
Please , Can you give a simple example?
Thank you very much :)
JEE (jeeswg) "Better WinGetPos" : LIEN Forum AHK
AHK Vision Go : LIEN Forum AHK
Simply Backup Script : LIEN Forum AHK
HotKeyIt
Posts: 2364
Joined: 29 Sep 2013, 18:35
Contact:

Re: Gui & scroll bars

28 Oct 2017, 08:40

EDIT: This example is for AutoHotkey_H:

Code: Select all

Gui,+Scroll
Loop, 30
Gui,Add,Button,% "x0 w100 h20 y" (A_Index-1)*25, Button%A_Index%
Loop, 30
Gui,Add,Button,% "x105 w100 y" (A_Index-1)*25, Button%A_Index%
Loop, 30
Gui,Add,Button,% "x210 w100 y" (A_Index-1)*25, Button%A_Index%
Gui,Show, w200 h200
return
GuiClose:
ExitApp
User avatar
ScottMeyer
Posts: 33
Joined: 27 Sep 2017, 12:52
Contact:

Re: Gui & scroll bars

28 Oct 2017, 10:11

Hi,

Sorry don't work

i tested with this :

Code: Select all

#Include Class_ScrollGUI.ahk
Gui,+Scroll
Gui,+VScroll
Message Error :
Spoiler
The problem could be solved just as easily? I like the idea :P
JEE (jeeswg) "Better WinGetPos" : LIEN Forum AHK
AHK Vision Go : LIEN Forum AHK
Simply Backup Script : LIEN Forum AHK

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: No registered users and 376 guests