读书人

问个 Treeview 背景色的有关问题

发布时间: 2012-09-12 09:21:30 作者: rapoo

问个 Treeview 背景色的问题,
我用下面的代码设置 TreeView 的背景色,但出现一片白色空白,

VB code
    Dim lngStyle As Long    lngStyle = GetWindowLong(tvwRptList.hWnd, GWL_STYLE)    Call SetWindowLong(tvwRptList.hWnd, GWL_STYLE, lngStyle - TVS_HASLINES)    Call SetWindowLong(tvwRptList.hWnd, GWL_STYLE, lngStyle)    '½Úµã    Dim i As Long    For i = 1 To tvwRptList.Nodes.count        tvwRptList.Nodes(i).BackColor = mTreeBackColor 'RGB(255, 0, 0) 'mTreeBackColor        tvwRptList.Nodes(i).EnsureVisible    Next i        Call SendMessage(tvwRptList.hWnd, TVM_SETBKCOLOR, 0, ByVal mTreeBackColor)




[解决办法]
目测是什么控件盖住了。不妨用 SPY++看看类名

读书人网 >VB

热点推荐