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() IndexArray(0) = COLOR_GRAYTEXT NewColor(0) = QBColor(Int(Rnd * 16)) SetSysColors 1, IndexArray(0), RGB(141, 141, 141) End Sub Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer) Command2_Click End Sub