Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
TextControl(2)
End Sub
Private Sub TextControl(ByVal Index As Integer)
Try
Dim TmpControl As TextBox
'Me.Controls是因为TextBox直接放在form上,如果放在GroupBox中,测用GroupBox.Controls,如下
'TmpControl = GroupBox1.Controls("Label" & Index)
TmpControl = Me.Controls("TextBox" & Index)
TmpControl.Visible = False
Catch ex As Exception
End Try
End Sub
End Class