展开全部
Val(TextBox(n)(i).Text)
=
50
这句是错误的.
改作:TextBox(i).Text
=
"50"
n你明明定义的是个常量值为57,怎么是文件名.控件数组能不能是TextBox(n)(i)的吧.貌似二维数组.
写个模子供你参考(属性窗口中设置text1的index为0)
Private
Sub
Command1_Click()
For
i
=
0
To
9
If
Text1(i).Text
=
"优"
Then
Text1(i).Text
=
95
If
Text1(i).Text
=
"良"
Then
Text1(i).Text
=
85
If
Text1(i).Text
=
"中"
Then
Text1(i).Text
=
75
If
Text1(i).Text
=
"及格"
Then
Text1(i).Text
=
65
If
Text1(i).Text
=
"不及格"
Then
Text1(i).Text
=
50
Next
i
End
Sub
Private
Sub
Form_Load()
For
i
=
1
To
9
Load
Text1(i)
Text1(i).Top
=
Text1(0).Top
+
(i)
*
(Text1(0).Height)
Text1(i).Visible
=
True
Next
i
End
Sub
===========================================
你可以把textbox(57)中的textbox(0~18)当成第一组的18个元素,textbox(19~37)当成第二组,textbox(38~56)是第三组啊
=
50
这句是错误的.
改作:TextBox(i).Text
=
"50"
n你明明定义的是个常量值为57,怎么是文件名.控件数组能不能是TextBox(n)(i)的吧.貌似二维数组.
写个模子供你参考(属性窗口中设置text1的index为0)
Private
Sub
Command1_Click()
For
i
=
0
To
9
If
Text1(i).Text
=
"优"
Then
Text1(i).Text
=
95
If
Text1(i).Text
=
"良"
Then
Text1(i).Text
=
85
If
Text1(i).Text
=
"中"
Then
Text1(i).Text
=
75
If
Text1(i).Text
=
"及格"
Then
Text1(i).Text
=
65
If
Text1(i).Text
=
"不及格"
Then
Text1(i).Text
=
50
Next
i
End
Sub
Private
Sub
Form_Load()
For
i
=
1
To
9
Load
Text1(i)
Text1(i).Top
=
Text1(0).Top
+
(i)
*
(Text1(0).Height)
Text1(i).Visible
=
True
Next
i
End
Sub
===========================================
你可以把textbox(57)中的textbox(0~18)当成第一组的18个元素,textbox(19~37)当成第二组,textbox(38~56)是第三组啊
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询