禁用控件后,另作按钮滚动吧.#include <GuiConstantsEx.au3>
#include <GuiListView.au3>
#include <WindowsConstants.au3>
$GUI = GUICreate("Listview Custom Draw", 400, 300)
$ListView = GUICtrlCreateListView( "Column 1|Column 2|Column 3", 2, 2, 394, 268)
$hListView = GUICtrlGetHandle(-1)
_GUICtrlListView_SetExtendedListViewStyle($hListView, BitOR($LVS_EX_GRIDLINES, $LVS_EX_FULLROWSELECT, $LVS_EX_CHECKBOXES, $LVS_NOSCROLL))
For $i = 1 To 35
_GUICtrlListView_AddItem($hListView, "Row" & $i & ": Col 1", $i - 1)
For $j = 1 To 2
_GUICtrlListView_AddSubItem($hListView, $i - 1, "Row" & $i & ": Col " & $j + 1, $j)
Next
Next
GUICtrlSetState($ListView, $gui_disable)
$button1 = GUICtrlCreateButton('向上', 290, 280, 50, 18)
$button2 = GUICtrlCreateButton('向下', 340, 280, 50, 18)
GUISetState()
While 1
$msg = GUIGetMsg()
Switch $msg
Case $GUI_EVENT_CLOSE
GUIDelete()
Exit
Case $button2
_GUICtrlListView_Scroll($hListView, 0, 150)
Case $button1
_GUICtrlListView_Scroll($hListView, 0, -150)
EndSwitch
WEnd
|