VS2010怎么样创建控件数组

lghyfh 2011-05-23 04:58:30
然后在运行过程中根据需要动态显示...或者有更好的办法....谢谢各位...急
...全文
311 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
xiaoid 2011-05-25
  • 打赏
  • 举报
回复


' 固定控件数量;
dim _ctl as object(9)
dim i as int32

for i=0 to 9
_ctl(0)=new windows.forms.textbox
with _ctl(0)
.location=new drawing.point(x,y) '位置
.size=new drawing.size(w,h) '尺寸;
.name="text" & i.tostring()
.text="文本" & i.tostring
end with
next


' 如果是不确定数据的就用集合;
dim _ctls as collections.arraylist
dim n as int32


_ctls=new collections.arraylist

_ctls.add(new windows.forms.textbox)
n=_ctls.count-1
with _ctls(n)
'代码上同
end with


51Crack 2011-05-23
  • 打赏
  • 举报
回复
.net没有
lghyfh 2011-05-23
  • 打赏
  • 举报
回复
VS2010的控件数组怎么搞

16,554

社区成员

发帖
与我相关
我的任务
社区描述
VB技术相关讨论,主要为经典vb,即VB6.0
社区管理员
  • VB.NET
  • 水哥阿乐
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧