以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  TreeView控件的NodeMouseClick事件代码  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=48818)

--  作者:石四
--  发布时间:2014/4/6 10:50:00
--  TreeView控件的NodeMouseClick事件代码

TreeView控件的NodeMouseClick事件代码:

 

If e.Node.Level = 1 Then
    MainTable = Tables(e.Node.Text)
 Forms(e.Node.Text).show()
End If

------------------

项目有些表有窗口,有些没有。

  如果没有窗口,单击节点会弹出一个对话框“不存在这个窗口”。

不想出现这个提示,怎么办?

If Forms(e.Node.Text) = true

 Forms(e.Node.Text).show()
End If

 

好像这样写代码很山寨,正确的应该是?


--  作者:czy
--  发布时间:2014/4/6 11:42:00
--  

If forms.contains(e.Node.Text) Then
   Forms(e.Node.Text).show()
End If

--  作者:石四
--  发布时间:2014/4/6 17:58:00
--  
不错,又学到一招,谢谢。