Happy Codings - Programming Code Examples
Html Css Web Design Sample Codes CPlusPlus Programming Sample Codes JavaScript Programming Sample Codes C Programming Sample Codes CSharp Programming Sample Codes Java Programming Sample Codes Php Programming Sample Codes Visual Basic Programming Sample Codes


Visual Basic Programming Code Examples

Visual Basic > Applications VBA Code Examples

Make a form with a gradient background

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54
Make a form with a gradient background 'make a gradient form 'take a new form 'put a line on it: index number = 0 'a label with some text: set the BackStyle = transparant 'and put the next code on the form 'press F5 'you can make any change and use it 'in combination with splashscreen 'just enter the appropiate code Private sub Form_Load() Dim k% Const afstand = 15 Const vSKleur = &HFF on Error Resume Next Line1(0).X1 = 0: Line1(0).Y1 = 0 Line1(0).X2 = form1.Width: Line1(0).Y2 = 0 Label1.Width = form1.Width Label1.Move 0, 0 Label1.Align = 2 Me.Show Screen.MousePointer = vbHourglass For k = 1 To (form1.Height / Afstand) DoEvents Load Line1(k) Line1(k).X1 = 0: Line1(k).Y1 = Line1(k - 1).Y1 + Afstand Line1(k).X2 = form1.Width: Line1(k).Y2 = Line1(k - 1).Y1 + Afstand Line1(k).BorderColor = vSKleur * Int(vSKleur * (k / (form1.Height / Afstand))) Line1(k).Visible = True Next k Screen.MousePointer = vbNormal End Sub Private sub Form_KeyPress(KeyAscii as Integer) Unload form1 End Sub Private sub Form_Unload(Cancel as Integer) End End Sub Return