本帖最后由 kxing 于 2011-1-14 19:09 编辑
请问下如何点切换按钮后改变listview的风格呢
原有风格带checkbox的,切换后恢复默认风格。
麻烦高手赐教,多谢!#include <GuiConstantsEx.au3>
#include <GuiListView.au3>
#include <GuiImageList.au3>
GUICreate("listview", 200, 150)
$hListView = GUICtrlCreateListView("column", 2, 2, 200, 120)
_GUICtrlListView_SetExtendedListViewStyle($hListView,BitOR($LVS_SHOWSELALWAYS,$LVS_SINGLESEL,$LVS_EX_CHECKBOXES))
$but=guictrlcreatebutton("切换",10,125,60,20)
GUISetState()
_read($hListView)
while 1
switch guigetmsg()
case -3
exit
case $but
_GUICtrlListView_SetExtendedListViewStyle($hListView,BitOR($LVS_SHOWSELALWAYS,$LVS_SINGLESEL))
endswitch
wend
func _read($hlv)
guictrlsendmsg($hlv,$LVM_DELETEALLITEMS,0,0)
for $i=1 to 10
guictrlcreatelistviewitem($i&"_test",$hlv)
next
endfunc
|