以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  删除控件的问题  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=14982)

--  作者:kevin
--  发布时间:2011/12/8 21:25:00
--  删除控件的问题

Dim lbl As WinForm.Label

lbl = e.Form.CreateControl("lable1", ControlTypeEnum.Label)
lbl.Text = "Foxtable"
lbl.Left = 100
lbl.Top = 100
e.Form.AddControl(lbl)

 

这个代码是动态增加一个标签。我现在想知道,既然可以增加一个控件,删除这个控件是应该怎样呢?


--  作者:程兴刚
--  发布时间:2011/12/8 21:33:00
--  

if e.Form.ExistControl("lable1")= true

    e.Form.RemoveControl("lable1")

end if