Hi John, try using 'typeof':
ex
\\
dim myControl as System.Windows.Forms.Control
For Each myControl in myForm.Controls
if ((typeof myControl is System.Windows.Forms.TextBox) orelse _
(typeof myControl is System.Windows.Forms.Label)) Then
myControl.Text = String.Empty
end if
next
//
code written off the top of my head so watch out for syntax...
hope this helps,
jim
"John Suru" <an*******@discussions.microsoft.com> wrote in message
news:01****************************@phx.gbl...
How do I cycle through all controls on a form singling
out just textboxes and comboboxes and clearing their text
property? I think I need to address the controls
collection and only clear the text property if the
control is a textbox or a combobox. How do I do this?
Thanks,
John Suru