以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  动态增加控件  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=113348)

--  作者:kaituozhe
--  发布时间:2018/1/14 11:55:00
--  动态增加控件

动态增加一个panel,这个面板的停靠位置为靠下,代码该怎么写,以下代码应该怎么修改?

 

Dim lbl As WinForm.Panel
lbl = e.Form.CreateControl("Panel1", ControlTypeEnum.Panel)
lbl.name = "Foxtable"
lbl.Left = 100
lbl.Top = 400
e.Form.AddControl(lbl)


--  作者:有点甜
--  发布时间:2018/1/14 18:20:00
--  
Dim lbl As WinForm.Panel
lbl = e.Form.CreateControl("Panel1", ControlTypeEnum.Panel)
lbl.name = "Foxtable"
lbl.Left = 100
lbl.Top = 400
lbl.backcolor = color.red
lbl.dock = 2 \'0-5 none 上下左右 fill
e.Form.AddControl(lbl)

--  作者:kaituozhe
--  发布时间:2018/1/14 19:06:00
--  

以下代码是想在窗口中加一个面板,然后在面板中再加入一个table,可是报错了,该怎么修改?

Dim Pan As WinForm.Panel
Pan = e.Form.CreateControl("Panel1", ControlTypeEnum.Panel)
Pan.name = "Foxtable"
Pan.Height = 200
Pan.backcolor = color.LightSkyBlue
Pan.dock = 2
e.Form.AddControl(Pan)
Dim tab As WinForm.Table
tab = e.Form.CreateControl("table1", ControlTypeEnum.Table)
tab.name = "table1"
tab.Height = 200
\'tab.backcolor = color.LightSkyBlue
tab.dock = 5
e.Form.Controls("Foxtable").AddControl(tab)


--  作者:有点甜
--  发布时间:2018/1/14 20:17:00
--  

添加table,是要这样处理的。

 

http://www.foxtable.com/webhelp/scr/1919.htm