首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > VB >

怎样为treeview添加背景图片,该如何处理

2012-01-14 
怎样为treeview添加背景图片如题[解决办法]http://www.china-askpro.com/msg33/qa45.shtml[解决办法]图片

怎样为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

看看结果如何

热点排行