Developing a user-friendly and vibrant color application using Visual Basic, or VB, can be as easy as adding text to a control. In VB, the ForeColor property can be used to change the font color of almost any control that uses text. The font color of VB controls on a form use the system colors by default, but they can be changed dynamically. In programming, one way you can use the FontColor property is to change the color of text to communicate information to the user, such as a green for "Pass" and red for "Fail."
Things You'll Need
- Microsoft Visual Basic Express
Launch Microsoft Visual Basic Express, click "New Project" on the left pane of your screen and then select "Windows Forms Application." Click "OK."
Double-click "TextBox" on the Toolbox pane to add the control to the form, and double-click "Button" to add a new button.
Double-click "Button1" to create the button click event procedure. Type the following code inside the procedure to change the font color of the text box control:
Me.TextBox1.ForeColor = Color.ForestGreen
Press "F5" to run your program, then type a sentence in the text box control. Press "Button1" to change the font color to forest green.
- Photo Credit Chad Baker/Photodisc/Getty Images
How Do I Change the Default Comment in Microsoft Excel?
Excel 2013 does not provide a feature to customize the default comments. You can customize individual comments using the Format Comment dialogue...
How to Change Font Color & Size
When designing websites, the font size, by default, is 10 to 12 points. Most of the time, unless you are using a...
How to Change a Visual Studio Color Scheme
Hours of looking at a screen when coding can strain your eyes, but you can relieve them by changing the color scheme...
How to Change the Command Button Color in a Visual Basic 6.0
Part of creating Visual Basic applications is designing buttons that make it easy for users to navigate through the application and provide...
How to Change the Text Color of Labels in VB6.0
Visual Basic labels help with navigation of your desktop applications. Visual Basic 6.0 is an older language used to create Windows software....