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


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

主题:treeview控件宽度

帅哥,在线噢!
有点蓝
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:110746 积分:563656 威望: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


 回到顶部