控件数组怎么破?
vb.net吧
全部回复
仅看楼主
level 3
我在百度上面看到的教程基本上都要事先制定好数量。。
如果我要点一下多一个怎么搞?!
2016年08月05日 12点08分 1
level 10
dim clist as new list(of control)
clist.add(新控件)
dim c as control = clist(0) '根据序列访问
mybase.controls.add(c) '把控件添加到窗体上
2016年08月05日 12点08分 2
控件的名字一定要定好?还是指控件类型?
2016年08月05日 13点08分
level 10
数组没有名字,只有序列。序列从0开始,按照添加的数序排列。
如果你想要名字,可以用
Dim clist As New Dictionary(Of String, Control)
clist.Add("我是一个按钮", New Button)
clist.Add("我是一个lab", New Label)
Dim but As Button = clist("我是一个按钮")
Dim lab As Label = clist("我是一个lab")
2016年08月05日 13点08分 3
[啊]
2016年08月05日 13点08分
level 13
控件数组已过时。你需要创建一个ItemsControl,然后给它合适的DataTemple,再把ObservableCollection(Of T)绑定到那个控件。
---贴吧极速版 For UWP
2016年08月05日 16点08分 4
level 7
redim
2016年08月20日 15点08分 6
1