本帖最后由 tubaba 于 2018-3-28 19:30 编辑
使用$WS_EX_CONTROLPARENT会导致子窗口滚动条不能使用鼠标操作,何解?
库文件在此
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <GuiScrollBars_Ex.au3>
#include <ScrollBarConstants.au3>
#include <SendMessage.au3>
#include <WinAPI.au3> ; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
Global $Form[6]
$hGUI = GUICreate("Test", 400, 300)
$button0 = GUICtrlCreateButton(" 0 ", 5, 5)
$button1 = GUICtrlCreateButton(" 1 ", 5, 35)
For $tabForm = 0 To 1
;~ $Form[$tabForm] = GUICreate("", 200, 100, 200, 200, BitOR($WS_CHILD, $WS_TABSTOP), -1, $hGUI);不带$WS_EX_CONTROLPARENT则正常
$Form[$tabForm] = GUICreate("", 200, 100, 200, 200, BitOR($WS_CHILD, $WS_TABSTOP), $WS_EX_CONTROLPARENT, $hGUI);使用$WS_EX_CONTROLPARENT会导致子窗口滚动条不能使用鼠标操作,何解?
GUISetBkColor(0xF5F5F5, $Form[$tabForm])
GUICtrlCreateLabel("Form " & $tabForm, 20, 20)
GUICtrlCreatebutton("button" & $tabForm, 20, 50)
GUICtrlCreatebutton("button2" & $tabForm, 20, 80)
_GUIScrollbars_Generate($Form[$tabForm], 0, 200)
Next
GUISetState(@SW_SHOW, $Form[0])
GUISetState(@SW_SHOW, $hGUI)
$button = $Form[0]
While 1
Switch GUIGetMsg()
Case $GUI_EVENT_CLOSE
Exit
Case $button0
GUISetState(@SW_HIDE, $button)
GUISetState(@SW_SHOW, $Form[0])
$button = $Form[0]
Case $button1
GUISetState(@SW_SHOW, $Form[1])
GUISetState(@SW_HIDE, $button)
$button = $Form[1]
EndSwitch
WEnd
|