我正在尝试格式化复选框的文本,但我得到'对象引用未设置为对象的实例。'例外。 有什么想法吗?
Dim i As Decimal = 0
Dim Cb As CheckBox
Dim tr As Control
Dim td As Control
Dim cont As New Control
For Each tr In TableSfarimNosafim.Controls
For Each td In tr.Controls
For Each cont In td.Controls
'Cb = DirectCast(cont, CheckBox)
Cb = TryCast(cont, CheckBox)
Cb.Text = clsTargumKodim.SfarimNosafim(i)
i = i + 1
Next
Next
Next
谢谢:)