Already found the solution (I love the API-Guide
):
Code:
Private Declare Function CreateBrushIndirect Lib "gdi32" (lpLogBrush As LOGBRUSH) As Long
Private Declare Function FillRect Lib "user32" (ByVal hDC As Long, lpRect As RECT, ByVal hBrush As Long) As Long
Private Type RECT
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type
Private Type LOGBRUSH
lbStyle As Long
lbColor As Long
lbHatch As Long
End Type
Private Const BS_SOLID = 0
Private Sub Form_Resize()
Dim LB As LOGBRUSH
Dim hBrush As Long
Dim rTest As RECT
frmMain.ScaleMode = vbPixels
frmMain.AutoRedraw = True
LB.lbStyle = BS_SOLID
LB.lbColor = RGB(0, 0, 192)
With rTest
.Top = 10
.Left = 10
.Bottom = frmMain.ScaleHeight - 10
.Right = frmMain.ScaleWidth - 10
End With
hBrush = CreateBrushIndirect(LB)
frmMain.Cls
Call FillRect(frmMain.hDC, rTest, hBrush)
frmMain.Refresh
End Sub