- 1). 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.
- 2). Click the "New" tab, select the "Standard.EXE" project type and click the "OK" button to continue.
- 3). Select "Project" and then "Components" then check the box for "Microsoft Rich Textbox Control 6.0" and click the button labeled "OK."
- 4). Double-click the "RichTextBox" icon to insert a RichTextBox control in the Window labeled "Form1."
- 5). Double-click the "Button" icon to insert a button control labeled "Button1" in the Window labeled "Form1."
- 6). Double-click the "Button" icon to insert a button control labeled "Button2" in the Window labeled "Form1."
- 7). Double-click the "Button1" icon and insert the following code to write to the RichTextBox control:
RichTextBox1.Text = "Test text" - 8). Double-click the "Button2" icon and insert the following code to read the text from the RichTextBox control:
Msgbox(RichTextBox1.Text) - 9). 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.
previous post