VB6.0 treeview背景问题
我用sendmessage对TreeView改变背景色时遇到个问题,那就是:每个节点的最后一个子节点展开后会产生一个下拉的白色背景块,而其他子节点展开不会产生这种情况re...
我用sendmessage对TreeView改变背景色时遇到个问题,那就是:每个节点的最后一个子节点展开后会产生一个下拉的白色背景块,而其他子节点展开不会产生这种情况refresh方法不管用,(比如:下面图片的最左端出现的白色长条)这种情况如何解决? 有关源码是: Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Long) As Long Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long) As Long Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long Private Const GWL_STYLE = -16& Private Const TVM_SETBKCOLOR = 4381& Private Const TVM_GETBKCOLOR = 4383& Private Const TVS_HASLINES = 2& Private Sub ApplyTRVBackColor(ByVal sColor As Long) Dim lngStyle As Long, iNode As Node TreeView1.LineStyle = tvwTreeLines Call SendMessage(TreeView1.hWnd, TVM_SETBKCOLOR, 0, ByVal sColor) lngStyle = GetWindowLong(TreeView1.hWnd, GWL_STYLE) Call SetWindowLong(TreeView1.hWnd, GWL_STYLE, lngStyle - TVS_HASLINES) Call SetWindowLong(TreeView1.hWnd, GWL_STYLE, lngStyle) For Each iNode In TreeView1.Nodes iNode.BackColor = sColor Next End Sub 如果能够解决问题,追加100分,谢谢。
展开
1个回答
微测检测5.10
2023-05-10 广告
2023-05-10 广告
您好!建议咨 深圳市微测检测有限公司,已建立起十余个专业实验室,企业通过微测检测就可以获得一站式的测试与认 证解决方案;(EMC、RF、MFi、BQB、QI、USB、安全、锂电池、快充、汽车电子EMC、汽车手机互 联、语音通话质量),认证遇...
点击进入详情页
本回答由微测检测5.10提供
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询