声明子VB时如何使用数组

时间:2015-11-22 23:43:09

标签: vb.net

我想知道在声明sub时有一种方法可以使用数组。

示例:

Public Class Form1
Private PictureBox(2) as PictureBox

Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
PictureBox(0) = PictureBox1
PictureBox(1) = PictureBox2
PictureBox(2) = PictureBox3

Private Sub PictureBox_mouseDown(sender As Object, e As MouseEventArgs) Handles PictureBox(1).MouseDown
'do stuff here
end sub

0 个答案:

没有答案