作者:laerla君君 | 来源:互联网 | 2023-10-11 15:52
Ihavealistboxthatcontainsitemsthatarerepresentedbyasingletextbox.我有一个列表框,其中包含由单个文本框表示
I have a list box that contains items that are represented by a single textbox.
我有一个列表框,其中包含由单个文本框表示的项。
When the user clicks a button, I want to iterate thru all these text boxes and check if their binding expressions are clean of errors; Should be something like:
当用户单击一个按钮时,我希望遍历所有这些文本框,并检查它们的绑定表达式是否为清除错误;应该是类似的:
Dim errCount = 0
For Each item In MyListBox.ListBoxItems 'There is no such thing ListBoxItems which is actually what I am looking for.
Dim tb As TextBox = item '.........Dig in item to extract the textbox from the visual tree.
errCount += tb.GetBindingExpression(TextBox.TextProperty).HasError
Next
If errCount Then
'Errors found!
End If
Any discussion would be really appreciated. Thanks.
如有任何讨论,我们将不胜感激。谢谢。
2 个解决方案