怎样为treeview添加背景图片
如题
[解决办法]
http://www.china-askpro.com/msg33/qa45.shtml
[解决办法]
图片碎裂是因为当节点展开的时候没有强制背景刷新
你试试在LGYAN(紫衣随想)的代码那里添加声明:
Public Const WM_LBUTTONDOWN = &H201
Public Const WM_RBUTTONDOWN = &H204
Public Const WM_RBUTTONDBLCLK = &H206
Public Const WM_LBUTTONDBLCLK = &H203
然后把下面的代码:
ElseIf wMsg = WM_HSCROLL Or wMsg = WM_VSCROLL Or wMsg = WM_MOUSEWHEEL Then
'Force a repaint to keep the bitmap
'tiles lined up
InvalidateRect hWnd, 0, 0
修改成:
ElseIf wMsg = WM_HSCROLL Or wMsg = WM_VSCROLL Or wMsg = WM_MOUSEWHEEL _
or wMsg = WM_LBUTTONDOWN or wMsg = WM_RBUTTONDOWN or wMsg = WM_RBUTTONDBLCLK or wMsg = WM_LBUTTONDBLCLK Then
'Force a repaint to keep the bitmap
'tiles lined up
InvalidateRect hWnd, 0, 0
看看结果如何