VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Change Font Color On Form

by Megagix (2 Submissions)
Category: Custom Controls/Forms/Menus
Compatability: Visual Basic 3.0
Difficulty: Beginner
Date Added: Wed 3rd February 2021
Rating: (3 Votes)

This code will change the forecolor for Labels and Textboxes (can be edited for Other Controls).

Rate Change Font Color On Form

Sub ChangeFont(frm As Form, color As String)
On Error GoTo errhand
Dim Control
For Each Control In frm.Controls
If TypeOf Control Is Label Then Control.ForeColor = color
If TypeOf Control Is TextBox Then Control.ForeColor = color
Next Control
Exit Sub
errhand:
MsgBox "Error Changing Font Color!", vbCritical
End Sub

Download this snippet    Add to My Saved Code

Change Font Color On Form Comments

No comments have been posted about Change Font Color On Form. Why not be the first to post a comment about Change Font Color On Form.

Post your comment

Subject:
Message:
0/1000 characters