Advertisement
coderail

Fusion Theme - VB.NET

Sep 24th, 2011
4,804
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.52 KB | None | 0 0
  1. Imports System, System.Collections
  2. Imports System.Drawing, System.Drawing.Drawing2D
  3. Imports System.ComponentModel, System.Windows.Forms
  4.  
  5.  
  6. '------------------
  7. 'Creator: aeonhack
  8. 'Site: elitevs.net
  9. 'Created: 9/23/2011
  10. 'Changed: 9/23/2011
  11. 'Version: 1.0.0
  12. 'Theme Base: 1.5.2
  13. '------------------
  14. Class FusionTheme
  15. Inherits ThemeContainer152
  16.  
  17. Private Path As GraphicsPath
  18. Private Blend As ColorBlend
  19.  
  20. Sub New()
  21. MoveHeight = 34
  22. BackColor = Color.White
  23. TransparencyKey = Color.Fuchsia
  24.  
  25. SetColor("Sides", 47, 47, 50)
  26. SetColor("Gradient1", 52, 52, 55)
  27. SetColor("Gradient2", 47, 47, 50)
  28. SetColor("Text", Color.White)
  29. SetColor("Back", Color.White)
  30. SetColor("Border1", Color.Black)
  31. SetColor("Border2", 60, 60, 63)
  32. SetColor("Border3", 60, 60, 63)
  33. SetColor("Border4", Color.Black)
  34. SetColor("Blend1", Color.Transparent)
  35. SetColor("Blend2", 60, 60, 63)
  36.  
  37. Path = New GraphicsPath
  38.  
  39. Blend = New ColorBlend
  40. Blend.Positions = New Single() {0.0F, 0.5F, 1.0F}
  41. End Sub
  42.  
  43. Private P1, P2, P3, P4, P5 As Pen
  44. Private C1, C2, C3 As Color
  45. Private B1, B2 As SolidBrush
  46.  
  47. Protected Overrides Sub ColorHook()
  48. P1 = New Pen(TransparencyKey, 3)
  49. P2 = New Pen(GetColor("Border1"))
  50. P3 = New Pen(GetColor("Border2"))
  51. P4 = New Pen(GetColor("Border3"))
  52. P5 = New Pen(GetColor("Border4"))
  53.  
  54. C1 = GetColor("Sides")
  55. C2 = GetColor("Gradient1")
  56. C3 = GetColor("Gradient2")
  57.  
  58. B1 = New SolidBrush(GetColor("Text"))
  59. B2 = New SolidBrush(GetColor("Back"))
  60.  
  61. Blend.Colors = New Color() {GetColor("Blend1"), GetColor("Blend2"), GetColor("Blend1")}
  62.  
  63. BackColor = B2.Color
  64. End Sub
  65.  
  66. Private RT1 As Rectangle
  67.  
  68. Protected Overrides Sub PaintHook()
  69. G.DrawRectangle(P1, ClientRectangle)
  70. G.SetClip(Path)
  71.  
  72. G.Clear(C1)
  73.  
  74. DrawGradient(C2, C3, 0, 0, 16, Height)
  75. DrawGradient(C2, C3, Width - 16, 0, 16, Height)
  76.  
  77. DrawText(B1, HorizontalAlignment.Left, 12, 0)
  78.  
  79. RT1 = New Rectangle(12, 34, Width - 24, Height - 34 - 12)
  80.  
  81. G.FillRectangle(B2, RT1)
  82. DrawBorders(P2, RT1, 1)
  83. DrawBorders(P3, RT1)
  84.  
  85. DrawBorders(P4, 1)
  86. DrawGradient(Blend, 1, 1, Width - 2, 2, 0.0F)
  87.  
  88. G.ResetClip()
  89. G.DrawPath(P5, Path)
  90. End Sub
  91.  
  92. Protected Overrides Sub OnResize(ByVal e As EventArgs)
  93. Path.Reset()
  94. Path.AddLines(New Point() { _
  95. New Point(2, 0), _
  96. New Point(Width - 3, 0), _
  97. New Point(Width - 1, 2), _
  98. New Point(Width - 1, Height - 3), _
  99. New Point(Width - 3, Height - 1), _
  100. New Point(2, Height - 1), _
  101. New Point(0, Height - 3), _
  102. New Point(0, 2), _
  103. New Point(2, 0)})
  104.  
  105. MyBase.OnResize(e)
  106. End Sub
  107.  
  108. End Class
  109.  
  110. '------------------
  111. 'Creator: aeonhack
  112. 'Site: elitevs.net
  113. 'Created: 9/23/2011
  114. 'Changed: 9/23/2011
  115. 'Version: 1.0.0
  116. 'Theme Base: 1.5.2
  117. '------------------
  118. Class FusionButton
  119. Inherits ThemeControl152
  120.  
  121. Sub New()
  122. SetColor("DownGradient1", 255, 127, 1)
  123. SetColor("DownGradient2", 255, 175, 12)
  124. SetColor("NoneGradient1", 255, 175, 12)
  125. SetColor("NoneGradient2", 255, 127, 1)
  126. SetColor("TextShade", 30, Color.Black)
  127. SetColor("Text", Color.White)
  128. SetColor("Border1", 255, 197, 19)
  129. SetColor("Border2", 254, 133, 0)
  130. End Sub
  131.  
  132. Private C1, C2, C3, C4 As Color
  133. Private B1, B2 As SolidBrush
  134. Private P1, P2 As Pen
  135.  
  136. Protected Overrides Sub ColorHook()
  137. C1 = GetColor("DownGradient1")
  138. C2 = GetColor("DownGradient2")
  139. C3 = GetColor("NoneGradient1")
  140. C4 = GetColor("NoneGradient2")
  141.  
  142. B1 = New SolidBrush(GetColor("TextShade"))
  143. B2 = New SolidBrush(GetColor("Text"))
  144.  
  145. P1 = New Pen(GetColor("Border1"))
  146. P2 = New Pen(GetColor("Border2"))
  147. End Sub
  148.  
  149. Protected Overrides Sub PaintHook()
  150. If State = MouseState.Down Then
  151. DrawGradient(C1, C2, ClientRectangle, 90.0F)
  152. Else
  153. DrawGradient(C3, C4, ClientRectangle, 90.0F)
  154. End If
  155.  
  156. DrawText(B1, HorizontalAlignment.Center, 1, 1)
  157. DrawText(B2, HorizontalAlignment.Center, 0, 0)
  158.  
  159. DrawBorders(P1, 1)
  160. DrawBorders(P2)
  161.  
  162. DrawCorners(BackColor)
  163. End Sub
  164.  
  165. End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement