重金跪求VB高手帮忙!基础题一个!!急!!Q:84469189
要求:设计如上图所示界面,编程使之能对文本框中内容进行相关格式设置。(界面中用到列表框、单选按钮、复选按钮、标签框、文本框)...
要求:
设计如上图所示界面,编程使之能对文本框中内容进行相关格式设置。(界面中用到列表框、单选按钮、复选按钮、标签框、文本框) 展开
设计如上图所示界面,编程使之能对文本框中内容进行相关格式设置。(界面中用到列表框、单选按钮、复选按钮、标签框、文本框) 展开
1个回答
展开全部
Option Explicit
Private Sub Check1_Click()
With CommonDialog1
Text1.FontUnderline = IIf(Check1.Value = 1, True, False)
End With
End Sub
Private Sub Check2_Click()
With CommonDialog1
Text1.FontBold = IIf(Check2.Value = 1, True, False)
End With
End Sub
Private Sub Check3_Click()
With CommonDialog1
Text1.FontItalic = IIf(Check3.Value = 1, True, False)
End With
End Sub
Private Sub Form_Load()
List1.AddItem 10
List1.AddItem 11
List1.AddItem 12
List1.AddItem 14
List1.AddItem 16
List1.AddItem 18
List1.AddItem 20
List1.AddItem 24
End Sub
Private Sub List1_Click()
With CommonDialog1
Text1.FontSize = Val(List1.Text)
End With
End Sub
Private Sub Option1_Click()
With CommonDialog1
Text1.ForeColor = &HFF&
End With
End Sub
Private Sub Option2_Click()
With CommonDialog1
Text1.ForeColor = &HFF00&
End With
End Sub
Private Sub Option3_Click()
With CommonDialog1
Text1.ForeColor = &HFF0000
End With
End Sub
Private Sub Check1_Click()
With CommonDialog1
Text1.FontUnderline = IIf(Check1.Value = 1, True, False)
End With
End Sub
Private Sub Check2_Click()
With CommonDialog1
Text1.FontBold = IIf(Check2.Value = 1, True, False)
End With
End Sub
Private Sub Check3_Click()
With CommonDialog1
Text1.FontItalic = IIf(Check3.Value = 1, True, False)
End With
End Sub
Private Sub Form_Load()
List1.AddItem 10
List1.AddItem 11
List1.AddItem 12
List1.AddItem 14
List1.AddItem 16
List1.AddItem 18
List1.AddItem 20
List1.AddItem 24
End Sub
Private Sub List1_Click()
With CommonDialog1
Text1.FontSize = Val(List1.Text)
End With
End Sub
Private Sub Option1_Click()
With CommonDialog1
Text1.ForeColor = &HFF&
End With
End Sub
Private Sub Option2_Click()
With CommonDialog1
Text1.ForeColor = &HFF00&
End With
End Sub
Private Sub Option3_Click()
With CommonDialog1
Text1.ForeColor = &HFF0000
End With
End Sub
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询