V
VB Programmer
How can I loop thru all textboxes on a form?
I want to remove any single quotes in the data entry. I was thinking
something like this:
For Each c As Control In Me.Controls
Dim t As TextBox = CType(c, TextBox)
t.Text = t.Text.Replace("'", "")
Next
But the CType is giving me a 'Specified cast is not valid'.
Thanks.
I want to remove any single quotes in the data entry. I was thinking
something like this:
For Each c As Control In Me.Controls
Dim t As TextBox = CType(c, TextBox)
t.Text = t.Text.Replace("'", "")
Next
But the CType is giving me a 'Specified cast is not valid'.
Thanks.