You can develop complex and sophisticated applications in Visual Basic 6, or VB6, with the aid of provided controls. The RichTextBox control is available to read, write and format text. Text can be displayed in the application or printed. You can use the control when requirements for text formatting exceed the capability of the standard text box control. A common use for this control is a notepad or text editor.
- Skill level:
Other People Are Reading
Select the "Start" icon located on the Windows menu bar and click "Microsoft Visual Basic 6.0" to start the Visual Basic integrated development environment.
Click the "New" tab, select the "Standard.EXE" project type and click the "OK" button to continue.
Select "Project" and then "Components" then check the box for "Microsoft Rich Textbox Control 6.0" and click the button labelled "OK."
Double-click the "RichTextBox" icon to insert a RichTextBox control in the Window labelled "Form1."
Double-click the "Button" icon to insert a button control labelled "Button1" in the Window labelled "Form1."
Double-click the "Button" icon to insert a button control labelled "Button2" in the Window labelled "Form1."
Double-click the "Button1" icon and insert the following code to write to the RichTextBox control:
RichTextBox1.Text = "Test text"
Double-click the "Button2" icon and insert the following code to read the text from the RichTextBox control:
Press the "F5" key to start the program in debug mode. Click "Button1" to write "test" in the RichTextBox. Click "Button2" to display a message box with the text "test" that was read from the RichTextBox.
- 20 of the funniest online reviews ever
- 14 Biggest lies people tell in online dating sites
- Hilarious things Google thinks you're trying to search for