|
设置数据表子窗体背景色
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 |
|