Fading The Form

This code shows you how to fade the form from black to light blue, but can be customised to any colour by using the RGB settings

'\\\\\\\\
Sub ColourFade(vForm As Form) 'Put this code into the form you wish to fade
   Dim intLoop As Integer
   vForm.DrawStyle = vbInsideSolid
   vForm.DrawMode = vbCopyPen
   vForm.ScaleMode = vbPixels
   vForm.DrawWidth = 2
   vForm.ScaleHeight = 256
   For intLoop = 0 To 255


'ATTENTION: This line you should change to a colour you want, RGB(0,500,255 - intLoop) makes the colour change from a florescent green to a vile turquiose!

   vForm.Line (0, intLoop)-(Screen.Width, intLoop - 1), RGB(0, 0, 255 - intLoop), B
   Next intLoop
End Sub

Private Sub Form_Activate()
ColourFade Me
End Sub
'////////

You might also like...

Comments

Antony Lees

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.” - Brian Kernighan