C
CSharp
C++
Java
Visual Basic
HTML - CSS
Android
Asp
Asp.Net
Php
Python
JavaScript
SQL
XML
Assembly
ActiveX
API
Code Snippets
Database
Files Directories Drives
Forms
Graphics Games
Multimedia
Strings
Windows and Controls
More...
Visual Basic > Code Snippets sample source codes
Visual Basic Code > Change text color in a text box
Change text color in a text box '2 command buttons and 1 text box required Option Explicit Private Declare Function SetSysColors Lib "user32" (ByVal nChanges _ As Long, lpSysColor As Long, lpColorValues As Long) As Long Dim NewColor(0) As Long Dim IndexArray(0) As Long Private Const COLOR_GRAYTEXT = 17 Private Sub Command1_Click() IndexArray(0) = COLOR_GRAYTEXT NewColor(0) = QBColor(Int(Rnd * 16)) SetSysColors 1, IndexArray(0), NewColor(0) End Sub Private Sub Command2_Click() Text1.Enabled = False End Sub
Privacy Policy
|
Contact
|
Advertising
|
Link to Us
|
Directory