Frame, Check Box, Option Button (Style Text) In Visual Basic

Hi buddy of Blues Pedia, this time I will discuss about usability and how to use Frame, Check Box, and Option Button in Visual Basic, Frame is a frame, but in visual basic, frame can we use to categorize a toolbox so that you can easily set the other toolbox, while the Check Box is a toolbox to mark something, and Option Button, toolbox to choose one thing, the difference between Check and Option, check we can use (choose) over a toolbox, while Option can only be one. For more details, I will create a basic program with criteria:
- Change Font Size
- Change Font Color
- Create Frame

The following tutorial :
 1. First, run the first Visual Basic and choose Standard EXE Project
2. Second, add 2 label (L). 1 text box (T), 2 Command button (C), and 1 frame, and then click the frame that has been made, and add 2 Check Box (CB), 2 Option Button (OB),
3. Change the caption, so like this:
because this is third tutorial of vb basic program, I assume you've been able to change the caption, if not please refer to the previous tutorial.


but for label 2, change the background to white, and the font in view (24), way in the properties menu label2, search "Backcolor" and change the color to white, and for font size, look for "Font" in the properties menu label 2 and click "..."


and change its size as desired, but here I write 24


4. Time to Script, click 2 times a form object, and then add the following script:

Private Sub Check1_click ()
Label2.FontBold = Check1.Value 'When check1 (Bold) marked so the caption label2 will Bold
End Sub

Private Sub Check1_click ()
Label2.FontItalic = Check2.Value 'When check1 (Italic) marked so the caption label2 will Italic
End Sub

Private Sub Command1_Click ()
Label2.Caption = Text1.Text 'Caption label2 will be same with text1, when command1 (OK) click
End Sub

Private Sub Command2_Click ()
End 'program will stop when Command2 (Done) clicked
End Sub

Private Sub Option1_click ()
Label2.ForeColor = VbRed 'Caption label2 will be red colored, when Option1 (RED) marked
End Sub

Private Sub Option2_click ()
Label2.ForeColor = vbBlue 'Caption label2 will be blue colored, when Option2 (Blue) marked
End Sub

5. Execution Time, Press F5
Input before, name / word in the text box, and then click OK, and try to mark one of the Option and Check Box, in the following picture:



That’s the tutorial on basic program that named by me Style Text. So this is enough for tutorial this time, still visiting Blues Pedia, for other interesting tutorials
Thank you and good luck

Popular Posts