老师好,不知哪里不对。
此主题相关图片如下:2024-10-30 19 08 52.png

Dim str4() As String = {"1","2","3","4","5"}For i As Integer = 1 To 5
Dim t2 As WinForm.Button = Forms("水电气数据查询").Controls("水电气数据" & i)
t2.text = str4(i-1)
t2.width = 75
t2.height = 23
t2.Top = 5 + 28 * (i-1)
t2.left = 3
t2.Font = New Font("微软雅体", 9)
t2.VisualStyle = VisualStyleEnum.office2010blue
e.Form.Controls("数据管理1") .AddControl(t2)
Next
老师,好了两个不同的控件设置了同一个名称。谢谢老师