0
我有大約50個Maskedtextboxes,只有少數可見。我需要的是隻檢查可見的,如果他們是空的。如何檢查vb.net中的空可見Maskedtextboxes?
我用這個代碼來檢查所有Maskedtextboxes:
Dim empty = TabLABOR.Controls.OfType(Of MaskedTextBox)().Where(Function(txt) txt.Text.Length = 0)
If empty.Any Then
MessageBox.Show(String.Format("Please fill all fields",
String.Join(",", empty.Select(Function(txt) txt.Name))))
Else
TabControlBlockD.SelectTab(TabMATERIALS)
End If
End Sub
謝謝,感謝你。但這並不是我想要的,我想要的只是檢查可見的。 –
哦。放在if語句中,條件是它應該是可見的。我相信這是用maskedtextbox.visible = true完成的 – deltu100