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 Const COLOR_APPWORKSPACE = 12
Dim L1 As Long ' 保存原来背景
Private Sub Command2_Click()
'设置为白色背景
SetSysColors 1, COLOR_APPWORKSPACE, RGB(255, 255, 255) '16764057 '16777215
'SetSysColors 1, COLOR_APPWORKSPACE, 16764057 '16777215
End Sub
Private Sub Command3_Click()
'恢复原来背景
SetSysColors 1, COLOR_APPWORKSPACE, L1
'SetSysColors 1, COLOR_APPWORKSPACE, l1
End Sub
Private Sub Form_Load()
'记录原来背景
L1 = GetSysColor(COLOR_APPWORKSPACE)
End Sub
Private Sub Form_Unload(Cancel As Integer)
'恢复原来背景
Command3_Click
End Sub作者: ivy021 时间: 2008-11-26 14:49
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
这些方法都要自己写的吧?[:41]作者: Henry D. Sy 时间: 2008-11-26 14:59
这些都是api函数的声明部分