Public Class Form1 'フォームにpictureBoxを10個入れる。 '入門用www_ほぇ~。 '入門者はコードでコントロールを作るな。ハハハ '背伸びをするな。基礎をやれ。 Dim my_pictureBox_kazu As Integer = 10 Dim my_pictureBox(my_pictureBox_kazu - 1) As PictureBox Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load my_pictureBox(0) = PictureBox1 my_pictureBox(1) = PictureBox2 my_pictureBox(2) = PictureBox3 my_pictureBox(3) = PictureBox4 my_pictureBox(4) = PictureBox5 my_pictureBox(5) = PictureBox6 my_pictureBox(6) = PictureBox7 my_pictureBox(7) = PictureBox8 my_pictureBox(8) = PictureBox9 my_pictureBox(9) = PictureBox10 For i As Integer = 0 To my_pictureBox_kazu - 1 my_pictureBox(i).BackColor = Color.Blue my_pictureBox(i).Size = New Size(10, 10) my_pictureBox(i).Location = New Point(30 + i * 20, 30) AddHandler my_pictureBox(i).Click, AddressOf my_pictureBox_click Next End Sub Private Sub my_pictureBox_click(ByVal sender As Object, ByVal e As EventArgs) MessageBox.Show(CType(sender, System.Windows.Forms.PictureBox).Name) End Sub End Class