by Anonymous (267 Submissions)
Category: Custom Controls/Forms/Menus
Compatability: Visual Basic 4.0 (32-bit)
Difficulty: Unknown Difficulty
Originally Published: Sat 13th March 1999
Date Added: Mon 8th February 2021
Rating: (1 Votes)
Add a gradient fram around a form.
If frm.WindowState = vbMinimized Then Exit Sub
size = size + 2
If smooth = True Then
frm.DrawStyle = 6
Else
frm.DrawStyle = 0
End If
If frm.ScaleWidth <> 255 Then
frm.ScaleWidth = 255
End If
If frm.ScaleHeight <> 255 Then
frm.ScaleHeight = 255
End If
frm.DrawWidth = 5
frm.Refresh
ri = (rs - re) / 255
gi = (gs - ge) / 255
bi = (bs - be) / 255
rc = rs: bc = bs: gc = gs
For X = 255 To 0 Step -1
DoEvents
frm.Line ((X / size%), (X / size%))-(frm.ScaleWidth - (X / size%), frm.ScaleHeight - (X / size%)), RGB(rc, gc, bc), B
rc = rc - ri
gc = gc - gi
bc = bc - bi
Next X
End Sub
'Sample for using this routine
Private Sub Form_Resize()
BoxGradient Form1, 111, 111, 222, 222, 255, 255, 5, True
End Sub