Public Class Form1 Private clsButton() As CtrlButtons Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load ReDim clsButton(2) For i As Integer = 0 To 2 clsButton(i) = New CtrlButtons Next clsButton(0).uctButton = Me.Button1 clsButton(1).uctButton = Me.Button2 clsButton(2).uctButton = Me.Button3 Me.Button4.Text = "ButtonのTextプロパティ変更を変更してみる" End Sub Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click Dim ret As Boolean = EditButtonText() End Sub 'ButtonのTextプロパティ変更(戻り値手抜きしてます) Public Function EditButtonText() As Boolean For i As Integer = 0 To clsButton.Count - 1 clsButton(i).uctButton.Text = "Textプロパティ変更 その" & i.ToString() Next Return True End Function 'ボタン処理用 Private Class CtrlButtons Private WithEvents mbtn As Button Public Property uctButton() As Button Get Return mbtn End Get Set(ByVal value As Button) mbtn = value End Set End Property Private Sub mbtn_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles mbtn.Click Const csMsg As String = "変更しました。" Const csFind As String = "変更" Dim btn As Button = DirectCast(sender, Button) If btn.Text.Contains(csFind) Then btn.Text = btn.Name Else btn.Text = btn.Name & " : " & csMsg End If End Sub End Class End Class