abdelfattah
Well-known Member
- Joined
- May 3, 2019
- Messages
- 1,507
- Office Version
- 2019
- 2010
- Platform
- Windows
hello
I search for highlight the title bar of a UserForm .
I have this code should highlight red ,but it doesn't
any solution experts ?
I search for highlight the title bar of a UserForm .
I have this code should highlight red ,but it doesn't
VBA Code:
Private Declare Function GetSysColor Lib "user32" (ByVal nIndex As Long) As Long
Private Declare Function SetSysColors Lib "user32" (ByVal nChanges As Long, lpSysColor As Long, lpColorValues As Long) As Long
Private originalColor As Long
Private Sub UserForm_Activate()
originalColor = GetSysColor(2)
Call SetSysColors(1, 2, RGB(255, 0, 0)) 'RGB(255,0,0) = RED
End Sub
Private Sub UserForm_Terminate()
Call SetSysColors(1, 2, originalColor)
End Sub