Option Explicit On Imports System Imports System.IO Public Class Form1 Private tstTXT() As TextBox '*1/4 Private Sub Form1_Load(sender As Object, e As EventArgs) Handles Me.Load InitControlsOnForm() End Sub Private Sub InitControlsOnForm() Dim I, J As Integer With Me .Text = "test form" .tstTXT = New TextBox(3 - 1) {} '*2/4 'End With Me.SuspendLayout() '------ For I = 0 To 3 - 1 tstTXT(I) = New TextBox '*3/4 Next I With .Controls .AddRange(Me.tstTXT) ''range'' for array '*4/4 End With For J = 0 To 3 - 1 With tstTXT(J) .Width = 100 .Left = J * .Width .Height = 10 .Top = 50 .Name = "tstTXT" + CStr(J) '*6.1/6 'to take event hander example ~_click() Option 'Is not able to be used 'needs to write on code to realize, 'in the reason any instances no existence 'on the first time. 'it is realized when code reading, 'not before static first, AddHandler .Click, AddressOf Me.tstMSG '*5/6 End With Next J .ResumeLayout(False) '------ .Width = 320 .Height = 200 End With End Sub Private Sub tstMSG( ByVal sender As Object, ByVal e As EventArgs) Dim senderNameSTR As String = CType(sender, TextBox ).Name '*6.2/6 MessageBox.Show(senderNameSTR) Dim i As Integer Dim msgSTR As String = "" For i = 0 To 2 If 0 < InStr(senderNameSTR, CStr(i)) Then Select Case i Case 0 msgSTR = "Asura World" Case 1 msgSTR = "Common World" Case 2 msgSTR = "Paradice World" End Select End If Next i MessageBox.Show("Hello, Wellcom to " + msgSTR + ".") End Sub End Class