デリゲート:
大体そんな感じですね。
テキストボックス3つとぼたん3つを置いて、ボタンを押すと
ボタンと同じ番号のTextBoxに書き込むコードを示します。
これを応用してみてください。
Delegate Sub degaddText(ByVal textBoxNo As Integer, ByVal textBoxText As String)
Private Sub addText(ByVal textBoxNo As Integer, ByVal textBoxText As String)
Select Case textBoxNo
Case 1
TextBox1.Text += textBoxText
Case 2
TextBox2.Text += textBoxText
Case 3
TextBox2.Text += textBoxText
End Select
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) _
Handles Button1.Click
Dim textBoxNo As Integer = 1
Dim textBoxText = "Button1"
Me.Invoke(New degaddText(AddressOf addText), New Object() {textBoxNo, textBoxText})
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) _
Handles Button2.Click
Dim textBoxNo As Integer = 2
Dim textBoxText = "Button2"
Me.Invoke(New degaddText(AddressOf addText), New Object() {textBoxNo, textBoxText})
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) _
Handles Button3.Click
Dim textBoxNo As Integer = 3
Dim textBoxText = "Button3"
Me.Invoke(New degaddText(AddressOf addText), New Object() {textBoxNo, textBoxText})
End Sub