VB关于option 的控件数组
运行效果如上代码如下PrivateSubForm_Load()Option1(0).Value=TrueOption2(0).Value=TrueOption3(0).V...
运行效果如上
代码如下
Private Sub Form_Load()Option1(0).Value = TrueOption2(0).Value = TrueOption3(0).Value = TrueOption4(0).Value = TrueText1.FontSize = 9Text1.FontBold = TrueText1.ForeColor = vbRedText1.FontName = "黑体"
End Sub
Private Sub Option1_Click(Index As Integer)Select Case IndexCase 0 Text1.FontSize = 9Case 1 Text1.FontSize = 16Case 2 Text1.FontSize = 24End SelectEnd Sub
Private Sub Option2_Click(Index As Integer)Select Case IndexCase 0 Text1.FontBold = True Text1.FontItalic = False
Case 1 Text1.FontBold = False Text1.FontItalic = TrueEnd SelectEnd Sub
Private Sub Option3_Click(Index As Integer)Select Case IndexCase 0 Text1.ForeColor = vbRedCase 1 Text1.ForeColor = vbBlueCase 2 Text1.ForeColor = vbGreenEnd SelectEnd Sub
Private Sub Option4_Click(Index As Integer)Select Case IndexCase 0 Text1.FontName = "黑体"Case 1 Text1.FontName = "宋体"Case 2 Text1.FontName = "隶书"End Select
End Sub
用控件数组制作,运行时选择出现问题 请问问题出现在哪里? 展开
代码如下
Private Sub Form_Load()Option1(0).Value = TrueOption2(0).Value = TrueOption3(0).Value = TrueOption4(0).Value = TrueText1.FontSize = 9Text1.FontBold = TrueText1.ForeColor = vbRedText1.FontName = "黑体"
End Sub
Private Sub Option1_Click(Index As Integer)Select Case IndexCase 0 Text1.FontSize = 9Case 1 Text1.FontSize = 16Case 2 Text1.FontSize = 24End SelectEnd Sub
Private Sub Option2_Click(Index As Integer)Select Case IndexCase 0 Text1.FontBold = True Text1.FontItalic = False
Case 1 Text1.FontBold = False Text1.FontItalic = TrueEnd SelectEnd Sub
Private Sub Option3_Click(Index As Integer)Select Case IndexCase 0 Text1.ForeColor = vbRedCase 1 Text1.ForeColor = vbBlueCase 2 Text1.ForeColor = vbGreenEnd SelectEnd Sub
Private Sub Option4_Click(Index As Integer)Select Case IndexCase 0 Text1.FontName = "黑体"Case 1 Text1.FontName = "宋体"Case 2 Text1.FontName = "隶书"End Select
End Sub
用控件数组制作,运行时选择出现问题 请问问题出现在哪里? 展开
展开全部
你确定你系统里 有隶书字体
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
不要将多个单选框放在frame1控件中,因为在frame1的单选控件就会可以多选,即单选框实际变成了多选框,这与你的初衷显然是不符的。故删除frame1控件即可。如果不想删除的话,那就修改一下代码即可。
如在Option1_Click事件中开头加入下面的代码。
for i=0 to 2
option1(i).value=false
next i
如在Option1_Click事件中开头加入下面的代码。
for i=0 to 2
option1(i).value=false
next i
本回答被提问者和网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询