【发布时间】:2015-05-23 06:20:30
【问题描述】:
我正在通过一个数组制作一组复选框。我可以毫无问题地将复选框放入我的表单中。我无法将复选框中的选中\未选中值输入到 Excel 电子表格中。在“如果 checkbox.checked = true then”行上,我收到错误“MissingMemberException 未处理”“未找到类型“标签”上的公共成员“已检查”。我在网上搜索过,我很难找到解决方案。
这是数组:
X = 30
Y = 75
Dim newCheck As CheckBox
For col As Integer = 1 To TskCnt
'create a new textbox and set its properties
newCheck = New CheckBox
newCheck.Size = New Size(15, 14)
newCheck.Location = New Point(X, Y)
newCheck.Name = "Check" & col
Me.Controls.Add(newCheck)
Y = Y + 40
Next
这是我试图获取值的地方:
For Each CheckBox In Me.Controls
If CheckBox.Checked = True Then
oSheet.Range("B" & RowN).Value = "Completed"
Else
oSheet.Range("B" & RowN).Value = "Incomplete"
End If
RowN = RowN + 1
Next
【问题讨论】:
-
我在这里的另一个线程中找到了我自己的解决方案:stackoverflow.com/questions/15876229/…
标签: arrays checkbox vb.net-2010