Public Class Form1 Dim But( 9) As Button ' 不要使用WithEvents和New进行声明 Private Sub Form1_Load( ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load ' ########################## ' 此段代码放在窗体Load事件或构造函数(Sub New)中 For i As Integer = 0 To But.Length - 1 ' 循环枚举控件 But(i) = New Button
VB.NET控件数组示例2则 (转载)
最新推荐文章于 2025-02-20 10:59:18 发布