以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  请教窗口TreeView 节点展开问题  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=185210)

--  作者:HJG_HB950207
--  发布时间:2023/2/10 11:14:00
--  请教窗口TreeView 节点展开问题
表A, 四列,年,月,日,记载
窗口1 建TreeView1 表A
     TreeView1节点为:年,月、日。
请教:
     每次窗口1打开时,   TreeView1默认只展开当前月所在的全部节点(年月日)


谢谢!





--  作者:有点蓝
--  发布时间:2023/2/10 11:17:00
--  
for each nd as winform.treenode in trv.nodes
if nd.text = cstr(date.today.year) then
nd.Expand()
for each nd2 as winform.treenode in nd.nodes
if nd.text = cstr(date.today.month) then
nd2.Expandall()
end if
next
exit for
end if
next