如题所问!同一窗口中的两个容器能不能同时添加同一个控件??
如下代码(部分截取,某些变量或常量已经定义)可否??
Dim box As WinForm.GroupBox = e.Form.Controls("GroupBox1整表")
Dim Rowedit As WinForm.GroupBox = e.Form.Controls("GroupBox1整行")
For i As Integer = 0 To djs.Length -1
Dim btn As WinForm.Button
btn = e.Form.CreateControl(djs(i),ControlTypeEnum.Button)
btn.Text = djs(i)
btn.Left = L
btn.Top = t
box.AddControl(btn)
Rowedit.AddControl(btn)
l = l + (w-(i+2)*10)/djs.Length
Next
红色部分到底行不行咧??麻烦老师了!
我这样做下来,只有后一个容器能够实现动态添加控件。
[此贴子已经被作者于2015/7/8 16:51:08编辑过]