1
我有一组一个小组的内部动态创建与下面的代码调用特定的用户控件动态创建
Dim X As Integer = 4
Dim Y As Integer = 0
For XRule As Integer = 0 To ArrayRuleNames.Length - 1
Dim MyRule As New RuleControl
Dim Location As Point
Location.X = X
Location.Y = Y
With MyRule
.RuleNameGpb.Text = ArrayRuleNames(XRule)
.RuleNumberTxt.Text = ArrayRuleNumbers(XRule)
.RuleNumberTxt.Tag = XRule
.SendBtn.Text = "Read"
.Parent = Me
.Location = Location
.Visible = True
End With
Panel.Controls.Add(MyRule)
Y += 80
Next
内的每个用户控件的用户控件的有像复选框和文本框的一些对象,我需要设置为True o错误Checked属性并从主窗体(WinForm)的Text属性上写入文本。
所以,我正在考虑在上面的代码中定义一个名称,然后通过名称来调用它们,这个概念是否正确,或者我应该以不同的方式做到这一点?