Visual Basic Codes
ActiveX
Miscellaneous
Applications
Code Snippets
Common Dialogs
Special Effects
Database Stuff
Date Time
Files Drives
Forms
Graphics Games
Internet Stuff
Multimedia
Other
Strings
Windows
Visual Basic > Forms sample source codes
Dither a Visual Basic Form
Dither a Visual Basic Form To dither a Visual Basic form, place the following code in the form. 'Purpose : Dither a form to blue 'Inputs : fmForm The form to dither 'Outputs : N/A 'Notes : Adjust the RGB line to change the dithering eg. Use RGB(255 - iLoop, 0, 0) for Red Private Sub FormDither(fmForm As Form) Dim iLoop As Integer, iScaleHeight As Integer, iScreenWidth As Integer On Error Resume Next iScaleHeight = Me.ScaleHeight iScreenWidth = Screen.Width fmForm.DrawStyle = vbInsideSolid fmForm.DrawMode = vbCopyPen fmForm.ScaleMode = vbPixels fmForm.DrawWidth = 2 For iLoop = 0 To iScaleHeight fmForm.Line (0, iLoop)-(iScreenWidth, iLoop - 1), RGB(0, 0, 255 - (255 / iScaleHeight) * iLoop), B Next iLoop On Error GoTo 0 End Sub Private Sub Form_Paint() FormDither Me End Sub Private Sub Form_Resize() FormDither Me End Sub
Privacy Policy
|
Link to Us
|
Links