Is it possible and if so how, to change the color of system color constants using the enum statement.
Im trying to change the tooltip colors (vbinfobackground).
Thanks in advance!
Mark_Dep :) :p
Printable View
Is it possible and if so how, to change the color of system color constants using the enum statement.
Im trying to change the tooltip colors (vbinfobackground).
Thanks in advance!
Mark_Dep :) :p
Try this.
Code:Private Declare Function SetSysColors Lib "user32" (ByVal nChanges As Long, lpSysColor As Long, lpColorValues As Long) As Long
Private Declare Function GetSysColor Lib "user32" (ByVal nIndex As Long) As Long
Const COLOR_INFOTEXT = 23 'Forecolor of ToolTipText
Const COLOR_INFOBK = 24 'BackColor of ToolTipText
Dim lForeColor
Dim lBackColor
Private Sub Form_Load()
'Get the current colour of the ToolTipText and Background
lForeColor = GetSysColor(COLOR_INFOTEXT)
lBackColor = GetSysColor(COLOR_INFOBK)
'Change the ForeColour to Green
SetSysColors 1, COLOR_INFOTEXT, vbGreen
'Change the BackColour to Blue
SetSysColors 1, COLOR_INFOBK, vbBlue
End Sub
Private Sub Form_Unload(Cancel As Integer)
'When the Form unloads, change the colours back to the original colours
SetSysColors 1, COLOR_INFOTEXT, lForeColor
SetSysColors 1, COLOR_INFOBK, lBackColor
End Sub