以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  窗体停靠的时候,visible永远是false?!  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=38622)

--  作者:zoomify
--  发布时间:2013/8/2 16:34:00
--  窗体停靠的时候,visible永远是false?!

 msgbox (Forms("窗口图纸打印").Visible)
Try
    Dim thePrint  As WinForm.Button = Forms("窗口图纸打印").Controls("ButtonPrint")
      thePrint.Text ="打印"
Catch ex As Exception

End Try
我把代码放到try里面,如果窗体是关闭的还是会出错,想判断下visible后,如果不可见就不执行,结果发现停靠的窗体即使可见,visible还是假。 有没有办法让不可见的窗体的引用在try中不要跳出错误呢?


--  作者:狐狸爸爸
--  发布时间:2013/8/2 17:15:00
--  
用opened吧