Advertisement
benito

Untitled

Sep 7th, 2011
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 3.23 KB | None | 0 0
  1. Class GreenTheme
  2.     Inherits ThemeContainer
  3.  
  4.     Sub New()
  5.         Font = New Font("Verdana", 8, FontStyle.Bold)
  6.         SetColor("BackColor", 33, 33, 33)
  7.         SetColor("LowerLineColor", 24, 24, 24)
  8.         SetColor("LowerLineColor2", 55, 55, 55)
  9.         SetColor("UpperLineColor", 120, 182, 52)
  10.         SetColor("BrushColor", 71, 132, 1)
  11.         SetColor("BrushColor2", 82, 156, 1)
  12.     End Sub
  13.  
  14.     Protected Overrides Sub ColorHook()
  15.         C1 = GetColor("BackColor")
  16.         C2 = GetColor("BrushColor")
  17.         C3 = GetColor("BrushColor2")
  18.         P1 = New Pen(GetColor("LowerLineColor"))
  19.         P2 = New Pen(GetColor("UpperLineColor"))
  20.         P3 = New Pen(GetColor("LowerLineColor2"))
  21.     End Sub
  22.  
  23.     Private C1, C2, C3 As Color
  24.     Private P1, P2, P3 As Pen
  25.  
  26.     Protected Overrides Sub PaintHook()
  27.         G.Clear(C1)
  28.         DrawGradient(C2, C3, 0, 0, Width, 30)
  29.         G.DrawLine(P3, 0, 30, Width, 30)
  30.         G.DrawLine(P1, 0, 31, Width, 31)
  31.         G.DrawLine(P2, 0, 29, Width, 29)
  32.         G.DrawLine(P2, 0, 0, Width, 0)
  33.         G.DrawLine(P2, 0, 0, 0, 29)
  34.         G.DrawLine(P2, Width - 1, 0, Width - 1, 29)
  35.         G.DrawLine(P3, Width - 1, 30, Width - 1, Height)
  36.         G.DrawLine(P3, 0, 30, 0, Height)
  37.         G.DrawLine(P1, 1, 31, 1, Height)
  38.         G.DrawLine(P1, Width - 2, 31, Width - 2, Height)
  39.         G.DrawLine(P3, 0, Height - 1, Width, Height - 1)
  40.         G.DrawLine(P1, 1, Height - 2, Width - 2, Height - 2)
  41.         DrawText(Brushes.Black, HorizontalAlignment.Left, 5, 3)
  42.     End Sub
  43. End Class
  44.  
  45. Class GreenLabel
  46.     Inherits Label
  47.  
  48.     Sub New()
  49.         Font = New Font("Verdana", 8, FontStyle.Regular)
  50.         BackColor = Color.FromArgb(33, 33, 33)
  51.         ForeColor = Color.White
  52.     End Sub
  53. End Class
  54.  
  55. Class GreenButton
  56.     Inherits ThemeControl
  57.  
  58.     Private Blend As ColorBlend
  59.  
  60.     Sub New()
  61.         Blend = New ColorBlend
  62.         Blend.Positions = New Single() {0, 0.5, 1}
  63.         SetColor("Blend1", 71, 132, 1)
  64.         SetColor("Blend2", 71, 132, 1)
  65.         SetColor("Blend3", 71, 132, 1)
  66.         SetColor("Shine", 0, 100, 0)
  67.         SetColor("Glow", Color.Green)
  68.         SetColor("Text", Color.White)
  69.         SetColor("Light", 71, 132, 1)
  70.         SetColor("Border", 120, 182, 85)
  71.     End Sub
  72.  
  73.     Protected Overrides Sub ColorHook()
  74.         B1 = New SolidBrush(GetColor("Shine"))
  75.         B2 = New SolidBrush(GetColor("Glow"))
  76.         B3 = New SolidBrush(GetColor("Text"))
  77.         P1 = New Pen(GetColor("Light"))
  78.         P2 = New Pen(GetColor("Border"))
  79.         Blend.Colors = New Color() {GetColor("Blend1"), GetColor("Blend2"), GetColor("Blend3")}
  80.     End Sub
  81.  
  82.     Private B1, B2, B3 As SolidBrush
  83.     Private P1, P2 As Pen
  84.  
  85.     Protected Overrides Sub PaintHook()
  86.         G.Clear(Color.FromArgb(71, 132, 1))
  87.         DrawGradient(Blend, ClientRectangle, 90)
  88.         G.FillRectangle(B2, ClientRectangle)
  89.         DrawText(B3, HorizontalAlignment.Center, 0, 0)
  90.         DrawBorders(P1, 1)
  91.         DrawBorders(P2)
  92.         If State = MouseState.Down Then
  93.             G.FillRectangle(B1, ClientRectangle)
  94.             DrawText(B3, HorizontalAlignment.Center, 0, 0)
  95.             DrawBorders(P2, 1)
  96.             DrawBorders(P2)
  97.         End If
  98.     End Sub
  99. End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement