Design a form in VB that includes formatting options for Check Box, Option Button, and Scrollbar.


Private Sub Check1_Click()
If Check1.Value = vb_checked Then
Text1.Font.Bold = False
Else
Text1.Font.Bold = True
End If
End Sub
Private Sub Check2_Click()
If Check2.Value = vb_checked Then
Text1.Font.Strikethrough = False
Else
Text1.Font.Strikethrough = True
End If
End Sub
Private Sub Check3_Click()
If Check3.Value = vb_checked Then
Text1.Font.Underline = False
Else
Text1.Font.Underline = True
End If
End Sub
Private Sub Check4_Click()
If Check4.Value = vb_checked Then
Text1.Font.Italic = False
Else
Text1.Font.Italic = True
End If
End Sub
Private Sub Command1_Click()
Clipboard.Clear
Clipboard.SetText Text1.SelText
Text1.SelText = ""
End Sub
Private Sub Command2_Click()
Form1.Hide
End Sub
Private Sub Command3_Click()
Text1.SelStart = 0
Text1.SelLength = Len(Text1.Text)
Text1.SetFocus
End Sub
Private Sub Command4_Click()
Text1.SelText = Clipboard.GetText()
End Sub
Private Sub Command5_Click()
Clipboard.Clear
Clipboard.SetText Text1.SelText
End Sub
Private Sub HScroll1_Change()
Text1.BackColor = RGB(HScroll1.Value, HScroll2.Value, HScroll3.Value)
End Sub
Private Sub HScroll2_Change()
Text1.BackColor = RGB(HScroll1.Value, HScroll2.Value, HScroll3.Value)
End Sub
Private Sub HScroll3_Change()
Text1.BackColor = RGB(HScroll1.Value, HScroll2.Value, HScroll3.Value)
End Sub
Private Sub Option1_Click()
If Option1.Value = True Then
Text1.FontName = "Arial Black"
End If
End Sub
Private Sub Option2_Click()
If Option2.Value = True Then
Text1.FontName = "Times New Roman"
End If
End Sub
Private Sub Option3_Click()
If Option3.Value = True Then
Text1.FontName = "Arial"
End If
End Sub
Private Sub Option4_Click()
If Option4.Value = True Then
Text1.FontSize = "10"
End If
End Sub
Private Sub Option5_Click()
If Option5.Value = True Then
Text1.FontSize = "45"
End If
End Sub
Private Sub Option6_Click()
If Option6.Value = True Then
Text1.FontSize = "15"
End If
End Sub
Private Sub Timer1_Timer()
Label4.Caption = Now
End Sub
Private Sub VScroll1_Change()
Text1.ForeColor = RGB(VScroll1.Value, VScroll2.Value, VScroll3.Value)
End Sub
Private Sub VScroll2_Change()
Text1.ForeColor = RGB(VScroll1.Value, VScroll2.Value, VScroll3.Value)
End Sub
Private Sub VScroll3_Change()
Text1.ForeColor = RGB(VScroll1.Value, VScroll2.Value, VScroll3.Value)
End Sub

Output:


About the Author

Unknown

Author & Editor

Has laoreet percipitur ad. Vide interesset in mei, no his legimus verterem. Et nostrum imperdiet appellantur usu, mnesarchum referrentur id vim.

Post a Comment

 
My Study Voice © 2015 - Designed by Templateism | Distributed By Blogger Templates