VB选择字体和字号后,再单击确定按钮,文本框中字体按选定的字体和字号显示

如题所述

'根据你的界面和要求,我写了段代码,复制上去就行了!
Private Sub Command1_Click()
If Option1.Value = True Then
Text1.FontName = "宋体"
ElseIf Option2.Value = True Then
Text1.FontName = "隶书"
ElseIf Option3.Value = True Then
Text1.FontName = "黑体"
End If
If Option4.Value = True Then
Text1.FontSize = 16 '三号
ElseIf Option5.Value = True Then
Text1.FontSize = 14 '四号
ElseIf Option6.Value = True Then
Text1.FontSize = 10.5 '五号
End If
'用中文的话比较麻烦的,上面我都标出来了,再给你个参数
'八号=5,七号=5.5,小六=6.5,六号=7.5,小五=9,五号=10.5,小四=12,四号=14,三号=16,小二=18,二号=22,小一=24,一号=26,小初=36
End Sub
温馨提示:答案为网友推荐,仅供参考
第1个回答  2013-06-04
text1.FontName=“宋体”
text1.FontSize=9
相似回答