Foxtable(狐表)用户栏目专家坐堂 → treeview控件宽度


  共有1474人关注过本帖树形打印复制链接

主题:treeview控件宽度

帅哥哟,离线,有人找我吗?
有点蓝
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:110574 积分:562760 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2024/4/13 15:40:00 [显示全部帖子]

Dim t As WinForm.TreeView = Forms("窗口3").Controls("TreeView1")
t.CollapseAll
t.SelectedNode = t.Nodes(0)
t.ExpandAll
Dim tn As WinForm.TreeNode = t.SelectedNode
Dim level As Integer = 0
For Each n As WinForm.TreeNode In t.AllNodes
    If n.Nodes.Count = 0 AndAlso n.Level > level Then
        tn = n
        level = n.Level
    End If 
Next 
Dim trv = t.BaseControl
Dim rg = trv.rectangletoscreen(tn.BaseNode.bounds)
Dim rg2 = Forms("窗口3").panel.rectangletoscreen(trv.bounds)

If rg.Right > rg2.Right Then 
    t.width = rg2.width + rg.Right - rg2.Right + 2
End if


 回到顶部