VB and VBA Users Source Code: Dither a Visual Basic Form
[
Home
|
Contents
|
Search
|
Reply
| Previous | Next ]
VB/VBA Source Code
Dither a Visual Basic Form
By:
Andrew Baker
Email (spam proof):
Email the originator of this post
Date:
Friday, December 15, 2000
Hits:
615
Category:
Visual Basic General
Article:
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 'Author : Andrew Baker 'Date : 13/12/2000 11:43 'Notes : Adjust the RGB line to change the dithering eg. Use RGB(255 - iLoop, 0, 0) for Red 'Revisions : 'Assumptions : 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
Terms and Conditions
Support this site
Download a trial version of the Excel Workbook Rebuilder