Loopings In VB.NET (FOR EACH)
问题 I am currently making a program in vb.net. it has lots of Text box inside of it. how do i clear them using for each loop. I have here my code but nothing happens in my program, my text boxes still have data. For Each txt As TextBox In personalInfo.Controls txt.Enabled = False Next by the way i have three group boxes with text boxes how do i clear all of text boxes with this code. 回答1: Use txt.Clear(); for clearing a TextBox. Are you sure that all controls in personalInfo are TextBoxes? If not