(vb程序设计)求代码:设计一个运行界面如下图所示的程序,要求单击单选按钮、复选框…… 50
设计一个运行界面如下图所示的程序,要求单击单选按钮、复选框、列表框或组合框时,立即在文本框中显示相应的文字格式。【提示】列表框中的字体可通过Screen对象的Fonts字...
设计一个运行界面如下图所示的程序,要求单击单选按钮、复选框、列表框或组合框时,立即在文本框中显示相应的文字格式。【提示】列表框中的字体可通过Screen对象的Fonts字符数组获得,组合框中的字号通过程序自动形成6~40磅值的偶数
展开
1个回答
展开全部
Private Sub Check1_Click()
If Check1.Value Then
Text1.Font.Bold = True
Else
Text1.Font.Bold = False
End If
End Sub
Private Sub Check2_Click()
If Check2.Value Then
Text1.Font.Italic = True
Else
Text1.Font.Italic = False
End If
End Sub
Private Sub Check3_Click()
If Check3.Value Then
Text1.Font.Underline = True
Else
Text1.Font.Underline = False
End If
End Sub
Private Sub Combo1_Click()
Text1.Font.Name = Combo1.Text
End Sub
Private Sub Command1_Click()
End
End Sub
Private Sub Form_Load()
Dim i As Integer
For i = 0 To Screen.FontCount - 1
Combo1.AddItem Screen.Fonts(i)
Next
Combo1.ListIndex = 0
For i = 6 To 40 Step 2
Combo2.AddItem i
Next
Combo2.ListIndex = 12
Text1.Font.Size = Combo2.Text
End Sub
Private Sub Option1_Click()
Text1.ForeColor = vbBlack
End Sub
Private Sub Option2_Click()
Text1.ForeColor = vbRed
End Sub
Private Sub Option3_Click()
Text1.ForeColor = vbBlue
End Sub
If Check1.Value Then
Text1.Font.Bold = True
Else
Text1.Font.Bold = False
End If
End Sub
Private Sub Check2_Click()
If Check2.Value Then
Text1.Font.Italic = True
Else
Text1.Font.Italic = False
End If
End Sub
Private Sub Check3_Click()
If Check3.Value Then
Text1.Font.Underline = True
Else
Text1.Font.Underline = False
End If
End Sub
Private Sub Combo1_Click()
Text1.Font.Name = Combo1.Text
End Sub
Private Sub Command1_Click()
End
End Sub
Private Sub Form_Load()
Dim i As Integer
For i = 0 To Screen.FontCount - 1
Combo1.AddItem Screen.Fonts(i)
Next
Combo1.ListIndex = 0
For i = 6 To 40 Step 2
Combo2.AddItem i
Next
Combo2.ListIndex = 12
Text1.Font.Size = Combo2.Text
End Sub
Private Sub Option1_Click()
Text1.ForeColor = vbBlack
End Sub
Private Sub Option2_Click()
Text1.ForeColor = vbRed
End Sub
Private Sub Option3_Click()
Text1.ForeColor = vbBlue
End Sub
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询