عوض کردن رنگ هاي سيستم
Option Explicit
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
Dim OrginalColor As Long
Dim NewColor(0) As Long
Dim IndexArray(0) As Long
Private Const COLOR_BTNTEXT = 18
Private Sub Command1_Click()
IndexArray(0) = COLOR_BTNTEXT
NewColor(0) = QBColor(Int(Rnd * 16))
SetSysColors 1, IndexArray(0), NewColor(0)
End Sub
Private Sub Command2_Click()
IndexArray(0) = COLOR_BTNTEXT
NewColor(0) = OrginalColor
SetSysColors 1, IndexArray(0), NewColor(0)
End Sub
Private Sub Form_Load()
OrginalColor = GetSysColor(COLOR_BTNTEXT)
Command1.Caption = "Change Color"
Command2.Caption = "Reset Color"
Randomize
End Sub
