Private Sub btnclearall_Click
Dim ctl As New Control
For Each ctl In Me.Controls
Next
'Ok above you looped through all controls on your form but did
'nothing with each itteration
'Now below is only checking one single control, the last one of your form
If Typeof ctl Is textbox Then
'Above you detemined ctl, is a texbox, so why are
'you creating a new text box and converting the
'the existing textbox into another textbox?
Dim txtcontrol As Textbox = Directcast (ctl.Textbox)
'Me is the form you are in, so the only thing
'you are changing is the text propert of the form itself
'not any of the text boxes.
Me.text = StringEmpty
See Rogachev's post above which shows how to correctly itterate thru the controls and clear the textboxes as it goes. But as an additional note, the coding provided will not itterate thru child controls within a container control. For example if you have a few panels and/or group boxes you would need to itterate thru each seperatly to find each of the child controls.