How can I cycle through all of the textbox controls on my form?
I thought it was something like..
VB Code:
Dim txt as TextBox For Each txt in Me.Controls 'Do something :D Next
But alas... :o
Printable View
How can I cycle through all of the textbox controls on my form?
I thought it was something like..
VB Code:
Dim txt as TextBox For Each txt in Me.Controls 'Do something :D Next
But alas... :o
this is for VB6 or .net?
either way your code is flawed in that you want to dim the var as a control
VB Code:
Dim ctrl as Control For Each ctrl in Me.Controls if TypeOf ctrl Is Textbox then 'Do something end if Next
this is the VB6 method.. sorry im not sure if it applies to .net
VB Code:
For Each ctrl as Control in Me.Controls if TypeOf ctrl Is Textbox then 'Do something end if Next