Jump to content

Child GUI + $WS_EX_CONTROLPARENT + Scrollbars = Scrollbars stop functioning


therks
 Share

Recommended Posts

I'm trying to implement a scrolling list of controls. I have it sort of working using the GUIScrollBars_Ex UDF by @Melba23 found here. I also want to be able to tab through the controls, which I have accomplished by adding $WS_EX_CONTROLPARENT to the child GUI. The problem is that with that style applied, the scrollbar doesn't act like a scrollbar, instead it acts as a title bar to the child GUI letting you drag the it around (and you can even "maximize" it by double clicking).

Any ideas?

#include <GUIConstants.au3>
#include "GUIScrollbars_Ex.au3"

$iButtonCount = 30

$hParent = GUICreate('Example', 300, 230)
$hChild = GUICreate('', 300, 200, 0, 0, BitOR($WS_CHILD, $WS_TABSTOP), $WS_EX_CONTROLPARENT, $hParent)
For $i = 0 To $iButtonCount
    GUICtrlCreateButton('Button in list', 0, $i*30, 300, 30)
Next
GUISwitch($hParent)
GUICtrlCreateButton('More Buttons', 0, 200, 150, 30)
GUICtrlCreateButton('More Buttons', 150, 200, 150, 30)

GUISetState(@SW_SHOW, $hParent)
GUISetState(@SW_SHOW, $hChild)

_GUIScrollbars_Generate($hChild, 100, $iButtonCount * 30+20)

While GUIGetMsg() <> $GUI_EVENT_CLOSE
WEnd

 

Link to comment
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
 Share

×
×
  • Create New...