[已解决]ListView加背景图后,先点击ListView再最小化窗口,再还原时显示有问题
本帖最后由 nnlenx 于 2011-4-29 11:18 编辑#include <GuiListView.au3>
#include <WindowsConstants.au3>
#include <GUIConstantsEx.au3>
Global $hListItem
$Main_GUI = GuiCreate("test", 600, 400, 60, 20)
$bj_main = GUICtrlCreatePic("C:\Documents and Settings\All Users\Documents\My Pictures\示例图片\Blue hills.jpg", 0, 0, 600, 400)
GUICtrlSetState(-1, $GUI_DISABLE)
$hListView = GuiCtrlCreateListView("", 20, 44, 530, 300, -1, BitOR($LVS_ICON, $LVS_EX_GRIDLINES, $LVS_EX_DOUBLEBUFFER, $LVS_EX_TWOCLICKACTIVATE))
_GUICtrlListView_SetExtendedListViewStyle($hListView, BitOR($LVS_EX_GRIDLINES, $LVS_EX_FULLROWSELECT, $LVS_EX_SUBITEMIMAGES));添加网格
_GUICtrlListView_AddColumn($hListView, " ", 20)
_GUICtrlListView_AddColumn($hListView, "TIME", 45, 1)
_GUICtrlListView_AddColumn($hListView, "PROVIDER ", 70)
_GUICtrlListView_AddColumn($hListView, "CHART # ", 70)
_GUICtrlListView_AddColumn($hListView, "PATIENT NAME ", 155)
_GUICtrlListView_AddColumn($hListView, "NOTE ", 158)
_GUICtrlListView_AddColumn($hListView, "RESOURCE", 72)
GUICtrlSetResizing($hListView, $GUI_DOCKLEFT + $GUI_DOCKRIGHT + $GUI_DOCKMENUBAR);设置某个控件的大小调整方式
GUICtrlSetColor($hListView, 0x0055ff);设置指定控件的文本颜色
GUICtrlSetBkColor ($hListView, 0xcfe4f5);设置指定控件的背景颜色
GUISetState()
For $i = 0 To10
问题:运行脚本后,先点击一下ListView中的行,然后再最小化窗口,
最后再还原窗口。就发现ListView中的内容显示有问题,请问有谁遇
到过,应该怎么处理呢?谢谢各位!
回复 1# nnlenx
自己搞掂:加上下面四行即可!!!!!!!!!!!!!
Case $GUI_EVENT_MINIMIZE
GUISetState(@SW_LOCK,$Main_GUI);锁定窗口,避免被重画.
Case $GUI_EVENT_RESTORE
GUISetState(@SW_UNLOCK,$Main_GUI);解锁窗口,允许被重画.
#include <GuiListView.au3>
#include <WindowsConstants.au3>
#include <GUIConstantsEx.au3>
Global $hListItem
$Main_GUI = GuiCreate("test", 600, 400, 60, 20)
$bj_main = GUICtrlCreatePic("C:\Documents and Settings\All Users\Documents\My Pictures\示例图片\Blue hills.jpg", 0, 0, 600, 400)
GUICtrlSetState(-1, $GUI_DISABLE)
$hListView = GuiCtrlCreateListView("", 20, 44, 530, 300, -1, BitOR($LVS_ICON, $LVS_EX_GRIDLINES, $LVS_EX_DOUBLEBUFFER, $LVS_EX_TWOCLICKACTIVATE))
_GUICtrlListView_SetExtendedListViewStyle($hListView, BitOR($LVS_EX_GRIDLINES, $LVS_EX_FULLROWSELECT, $LVS_EX_SUBITEMIMAGES));添加网格
_GUICtrlListView_AddColumn($hListView, " ", 20)
_GUICtrlListView_AddColumn($hListView, "TIME", 45, 1)
_GUICtrlListView_AddColumn($hListView, "PROVIDER ", 70)
_GUICtrlListView_AddColumn($hListView, "CHART # ", 70)
_GUICtrlListView_AddColumn($hListView, "PATIENT NAME ", 155)
_GUICtrlListView_AddColumn($hListView, "NOTE ", 158)
_GUICtrlListView_AddColumn($hListView, "RESOURCE", 72)
GUICtrlSetResizing($hListView, $GUI_DOCKLEFT + $GUI_DOCKRIGHT + $GUI_DOCKMENUBAR);设置某个控件的大小调整方式
GUICtrlSetColor($hListView, 0x0055ff);设置指定控件的文本颜色
GUICtrlSetBkColor ($hListView, 0xcfe4f5);设置指定控件的背景颜色
GUISetState()
For $i = 0 To10
$hListItem[$i] = _GUICtrlListView_AddItem($hListView, " ")
_GUICtrlListView_AddSubItem($hListView, $i, "11:30", 1)
_GUICtrlListView_AddSubItem($hListView, $i, "XYZZY", 2)
_GUICtrlListView_AddSubItem($hListView, $i, "PLUGH", 3)
_GUICtrlListView_AddSubItem($hListView, $i, "DOE, JOHN", 4)
_GUICtrlListView_AddSubItem($hListView, $i, "PLOVER", 5)
Next
While 1
$msg = GUIGetMsg()
Switch $msg
Case $GUI_EVENT_CLOSE
ExitLoop
Case $GUI_EVENT_MINIMIZE
GUISetState(@SW_LOCK,$Main_GUI);锁定窗口,避免被重画.
Case $GUI_EVENT_RESTORE
GUISetState(@SW_UNLOCK,$Main_GUI);解锁窗口,允许被重画.
EndSwitch
Wend
Exit 支持,学习了
页:
[1]