我想在 vb.net 和 wpf 中对文本框进行身份验证,确保在我将它们的内容提供给数据库之前它不包含空值,我正在考虑使用 for...each 语句,但它在 wpf 中不起作用。这里是我的代码。
for Each txt as Control in window.controls
if typeof is Textbox Then
if txt.text = "" Then
MsgBox("Complete the blank Properties")
exit sub
end if
end if
next
此代码不起作用,我收到错误消息:“窗口是一种类型,不能用作表达式”
我怎样才能做到这一点?