这个无法解决,你加入代码设置停靠吧
If e.Checked = True
'实现每选定一个项目,增加一个列宽设置的输入框,并把输入焦点移互列宽输入框,列宽默认值设为50
Dim lbl As WinForm.TextBox
lbl = e.Form.CreateControl(e.Sender.SelectedValue, ControlTypeEnum.TextBox) '用选定项目的值作为临时增加控件的名称
lbl.Left = 10
lbl.Width=50
lbl.Top = 20 + (e.Sender.CheckedIndices.Count)*20 '垂直位置平均增加相同的值
e.Form.Controls("Panel2").AddControl(lbl)
lbl.Dock = 1
lbl.Value = 80 '设置默认值
If lbl.Value = 80
e.Form.Controls(e.Sender.SelectedValue).Select '设置输入焦点到列宽值设置框
End If
Else
e.Form.RemoveControl(e.Sender.SelectedValue)
End If
Dim lb As WinForm.Label = e.Form.Controls("Label1")
lb.Text = (e.Sender.CheckedIndices.Count-1) * 20