treeview控件 TreeView1
PrivateDeclareFunctionGetWindowLongLib"User32"Alias"GetWindowLongA"(ByValhWndAsLong,ByValnIndexAsLong)AsLongPrivateDeclareFunctionSetWindowLongLib"Use
Private Declare Function GetWindowLong Lib "User32" Alias "GetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long) As LongPrivate Declare Function SetWindowLong Lib "User32" Alias "SetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As LongPrivate Const GWL_STYLE = -16&Private Const TVM_SETBKCOLOR = 4381&Private Const TVM_GETBKCOLOR = 4383&Private Const TVS_HASLINES = 2&Dim frmlastForm As FormPrivate Sub Form_Load()Dim nodX As NodeSet nodX = TreeView1.Nodes.Add(, , "R", "Root")Set nodX = TreeView1.Nodes.Add("R", tvwChild, "C1", "Child 1")Set nodX = TreeView1.Nodes.Add("R", tvwChild, "C2", "Child 2")Set nodX = TreeView1.Nodes.Add("R", tvwChild, "C3", "Child 3")Set nodX = TreeView1.Nodes.Add("R", tvwChild, "C4", "Child 4")nodX.EnsureVisibleTreeView1.style = tvwTreelinesText ' Style 4.TreeView1.BorderStyle = vbFixedSingleEnd SubPrivate Sub Command1_Click()Dim lngStyle As LongCall SendMessage(TreeView1.hWnd, TVM_SETBKCOLOR, 0, ByVal RGB(255, 0, 0))'改变背景到红色lngStyle = GetWindowLong(TreeView1.hWnd, GWL_STYLE)Call SetWindowLong(TreeView1.hWnd, GWL_STYLE, lngStyle - TVS_HASLINES)Call SetWindowLong(TreeView1.hWnd, GWL_STYLE, lngStyle)End Sub廖国娟2021-03-28 05:40:18属性里面改
- 标签:
- 编辑:田佳
- 相关文章
-
2022一本二本三本的分数线 报考人数减少
一本录取分数线预计在520分到570分左右,二本录取分数线预计在450分到500分左右,三本分数线预计在360-450分之间。目前绝大部分省份…
-
七夕佳句 送你短信祝福
在现实生活或工作学习中,大家都不可避免地要接触到短信吧,短信长度不超过160个英文或数字字符,或70个汉字,这与短信基于通信系统的信…
- 新宾蟒蛇事件 只能生活在热带
- 哥的拼音 两音相连猛一碰
- 服务器集群技术 从而方便地进行维护
- moon老婆 也包括美国本身的肖像
- 童谣大全 打春要吃春卷炒鸡蛋