www.pudn.com > shadform.zip > SHADFORM.BAS


Option Explicit 
 
Sub ShadeForm (Frm As Form) 
 
' Description 
'     Draws the "install-type" shaded background on a form 
' 
' Paramaters 
'     Name                 Type     Value 
'     ----------------------------------------------------------- 
'     Frm                  Form     The form to draw the shade on 
' 
' Returns 
'     Nothing 
' 
' Last modified by Gord MacLeod 05.02.96 
 
Dim i% 
Dim NumberOfRects As Integer 
Dim GradColor As Long 
Dim GradValue As Integer 
 
   Frm.ScaleMode = 3 
   Frm.DrawStyle = 6 
   Frm.DrawWidth = 2 
   Frm.AutoRedraw = True 
    
   NumberOfRects = 64 
     
   For i% = 1 To 64 
    
      GradValue = 255 - (i% * 4 - 1) 
        
      ' Put GradValue in Red and Green for a different look 
      GradColor = RGB(0, 0, GradValue) 
        
      ' Draw the line 
      Frm.Line (0, Frm.ScaleHeight * (i% - 1) / 64)-(Frm.ScaleWidth, Frm.ScaleHeight * i% / 64), GradColor, BF 
     
   Next i% 
 
   Frm.Refresh 
 
End Sub