Skip to content

Instantly share code, notes, and snippets.

@niwatpumkin
Created September 15, 2014 03:56
Show Gist options
  • Save niwatpumkin/6530d238360d661c27d1 to your computer and use it in GitHub Desktop.
Save niwatpumkin/6530d238360d661c27d1 to your computer and use it in GitHub Desktop.
Protected Sub btnclear_Click(sender As Object, e As EventArgs) Handles btnclear.Click 'ปุ่มนะ
ClearTextBox(Me) 'เรียกใช้ฟังก์ชั่นข้างล่าง
End Sub
Public Sub ClearTextBox(ByVal root As Control) 'เอาฟังชั่นนี้ไปใส่ไว้ตรงไหนก็ได้
For Each ctrl As Control In root.Controls
ClearTextBox(ctrl)
If TypeOf ctrl Is TextBox Then
CType(ctrl, TextBox).Text = String.Empty
End If
Next ctrl
End Sub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment