以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  窗口关闭后控件错误问题  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=29596)

--  作者:mamuaiqing
--  发布时间:2013/3/9 21:10:00
--  窗口关闭后控件错误问题

代码如下,在关闭窗口后提示找不到Button1控件,请教老师怎么回事

Dim tab As WinForm.TabControl = e.Form.Controls("TabControl1")
Dim qrxg As WinForm.Button = e.Form.Controls("Button1")
If tab.SelectedIndex = 1 Then
    If qrxg.Visible = True Then
        MessageBox.Show("请先确认修改后再离开界面!","错误提示", MessageBoxButtons.OK ,MessageBoxIcon.Information)
        e.Cancel = True
    End If
End If

 

 

 下载信息  [文件大小:   下载次数: ]
图片点击可在新窗口打开查看点击浏览该文件:管理项目14.zip


--  作者:czy
--  发布时间:2013/3/9 21:46:00
--  

这个问题好像要老六来解决。

 

现在只好先判断一下吧。

 

Dim tab As WinForm.TabControl = e.Form.Controls("TabControl1")
If e.Form.ExistControl("Button1")
    Dim qrxg As WinForm.Button = e.Form.Controls("Button1")
    If tab.SelectedIndex = 1 Then
        If qrxg.Visible = True Then
            MessageBox.Show("请先确认修改后再离开界面!","错误提示", MessageBoxButtons.OK ,MessageBoxIcon.Information)
            e.Cancel = True
        End If
    End If
End If


--  作者:mamuaiqing
--  发布时间:2013/3/10 0:05:00
--  
感谢czy老师~~~问题解决了~~