SoulZeh

StyleTheme Free

Nov 27th, 2011
488
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 12.44 KB | None | 0 0
  1. Imports System.Drawing.Drawing2D
  2.  
  3. '------------------
  4. 'Creator: SoulZeh
  5. 'Created: 23/11/2011
  6. 'Credits xZ3ROxPROJ3CTx, oVERT3Xo
  7. 'I Love him <3
  8. '------------------
  9. Class StyleTheme
  10.  
  11. Inherits ThemeContainer153
  12.  
  13. Sub New()
  14. TransparencyKey = Color.Fuchsia
  15. SetColor("Border 1", Color.FromArgb(54, 54, 54))
  16. SetColor("Border 2", Color.FromArgb(33, 33, 33))
  17. Font = New Font("Calibri", 9)
  18. BackColor = Color.FromArgb(24, 24, 24)
  19. SetColor("TopGloss", Color.FromArgb(62, Color.White))
  20. SetColor("BottomGloss", Color.FromArgb(30, Color.White))
  21. End Sub
  22. Protected Overrides Sub ColorHook()
  23. C1 = GetColor("Border 1")
  24. C2 = GetColor("Border 2")
  25. C3 = GetColor("TopGloss")
  26. C4 = GetColor("BottomGloss")
  27. End Sub
  28. Private C1, C2, C3, C4 As Color
  29. Private RT1 As Rectangle
  30. Protected Overrides Sub PaintHook()
  31.  
  32. DrawGradient(C1, C2, 0, 0, Width, Height)
  33. RT1 = New Rectangle(11, 25, Width - 22, Height - 35)
  34. G.FillRectangle(Brushes.White, RT1)
  35.  
  36. DrawGradient(C3, C4, New Rectangle(1, 1, Width - 2, 13), 90S)
  37. DrawBorders(Pens.Black)
  38. DrawCorners(Color.Fuchsia)
  39. DrawText(Brushes.White, HorizontalAlignment.Left, 7, 0)
  40.  
  41.  
  42. G.FillRectangle(New SolidBrush(Color.FromArgb(38, 38, 38)), New Rectangle(11, 25, Width - 22, Height - 35))
  43. Dim shadowLGB As New LinearGradientBrush(New Rectangle(11, 25, Width - 22, 20), Color.FromArgb(23, 23, 22), Color.FromArgb(38, 38, 38), 90S)
  44. G.FillRectangle(shadowLGB, New Rectangle(11, 25, Width - 22, 20))
  45. G.DrawLine(New Pen(New SolidBrush(Color.FromArgb(24, 24, 24))), 11, 26, Width - 11, 26)
  46. G.DrawRectangle(Pens.Black, New Rectangle(11, 25, Width - 22, Height - 35))
  47. G.DrawLine(New Pen(New SolidBrush(Color.FromArgb(151, 150, 146))), 1, 1, Width - 2, 1)
  48. G.DrawRectangle(New Pen(New SolidBrush(Color.FromArgb(42, 41, 37))), 10, 24, Width - 20, Height - 33)
  49. DrawCorners(Color.FromArgb(38, 38, 38), New Rectangle(11, 25, Width - 21, Height - 34))
  50. DrawCorners(Color.FromArgb(55, 55, 55), New Rectangle(9, 23, Width - 21, Height - 34))
  51. End Sub
  52. End Class
  53. Class xSeparator
  54. Inherits ThemeControl153
  55.  
  56. Protected Overrides Sub ColorHook()
  57.  
  58. End Sub
  59.  
  60. Protected Overrides Sub PaintHook()
  61. G.FillRectangle(New SolidBrush(Color.FromArgb(38, 38, 38)), ClientRectangle)
  62. DrawGradient(Color.FromArgb(55, 55, 55), Color.FromArgb(58, 58, 58), New Rectangle(0, Height / 2, Width, 2), 45S)
  63. End Sub
  64. End Class
  65. Class StyleButton
  66. Inherits ThemeControl153
  67.  
  68. Sub New()
  69. BackColor = Color.FromArgb(33, 33, 33)
  70.  
  71. SetColor("ButtonFillColor", Color.FromArgb(24, 24, 24))
  72. SetColor("ButtonClickColor", Color.FromArgb(40, 40, 40))
  73. SetColor("InsetBorderColor", Color.Black)
  74. SetColor("TopGloss", Color.FromArgb(62, Color.White))
  75. SetColor("BottomGloss", Color.FromArgb(30, Color.White))
  76. SetColor("TopInset", Color.FromArgb(45, 45, 45))
  77. SetColor("BottomInset", Color.FromArgb(95, 70, 70, 70))
  78. SetColor("BorderColor", Color.Black)
  79. SetColor("TextColor", Color.Orange)
  80. End Sub
  81. Dim C1, C2, C3, C4, C5, C6, C7, C8, C9 As Color
  82. Protected Overrides Sub ColorHook()
  83. C1 = GetColor("ButtonFillColor")
  84. C2 = GetColor("InsetBorderColor")
  85. C3 = GetColor("TopGloss")
  86. C4 = GetColor("BottomGloss")
  87. C5 = GetColor("TopInset")
  88. C6 = GetColor("BottomInset")
  89. C7 = GetColor("BorderColor")
  90. C8 = GetColor("TextColor")
  91. C9 = GetColor("ButtonClickColor")
  92. End Sub
  93.  
  94. Protected Overrides Sub PaintHook()
  95. G.Clear(BackColor)
  96. Select Case State
  97. Case 0
  98. G.FillRectangle(New SolidBrush(C1), New Rectangle(1, 1, Width - 2, Height - 2))
  99. DrawBorders(New Pen(New SolidBrush(C2)), 2)
  100. DrawGradient(C3, C4, New Rectangle(1, 1, Width - 2, Height / 2 - 2), 90S)
  101. Case 1
  102. G.FillRectangle(New SolidBrush(C1), New Rectangle(1, 1, Width - 2, Height - 2))
  103. DrawBorders(New Pen(New SolidBrush(C2)), 2)
  104. DrawGradient(C3, C4, New Rectangle(1, 1, Width - 2, Height / 2 - 2), 90S)
  105. Case 2
  106. G.FillRectangle(New SolidBrush(C9), New Rectangle(1, 1, Width - 2, Height - 2))
  107. DrawBorders(New Pen(New SolidBrush(C2)), 2)
  108. DrawGradient(C4, C4, New Rectangle(1, 1, Width - 2, Height / 2 - 2), 90S)
  109. End Select
  110.  
  111.  
  112. DrawBorders(New Pen(New SolidBrush(C7)), 1)
  113. G.DrawLine(New Pen(New SolidBrush(C5)), 0, 0, Width, 0)
  114. G.DrawLine(New Pen(New SolidBrush(C5)), 0, 0, 0, Height)
  115. G.DrawLine(New Pen(New SolidBrush(C5)), Width - 1, 0, Width - 1, Height)
  116. G.DrawLine(New Pen(New SolidBrush(C6)), 0, Height - 1, Width, Height - 1)
  117. DrawCorners(BackColor)
  118. DrawCorners(BackColor, New Rectangle(1, 1, Width - 2, Height - 2))
  119. DrawText(New SolidBrush(C8), HorizontalAlignment.Center, 0, 0)
  120. End Sub
  121. End Class
  122. Class StyleTabControl
  123. Inherits TabControl
  124. Private LightBlack As Color = Color.FromArgb(24, 24, 24)
  125. Private LighterBlack As Color = Color.FromArgb(24, 24, 24)
  126. Private DrawGradientBrush, DrawGradientBrush2 As LinearGradientBrush
  127. Private _ControlBColor As Color
  128. Public Property TabTextColor() As Color
  129. Get
  130. Return _ControlBColor
  131. End Get
  132. Set(ByVal v As Color)
  133. _ControlBColor = v
  134. Invalidate()
  135. End Set
  136. End Property
  137.  
  138. Sub New()
  139. MyBase.New()
  140. SetStyle(ControlStyles.AllPaintingInWmPaint Or _
  141. ControlStyles.ResizeRedraw Or _
  142. ControlStyles.UserPaint Or _
  143. ControlStyles.DoubleBuffer, True)
  144. TabTextColor = Color.White
  145. End Sub
  146. Protected Overrides Sub OnPaint(ByVal e As PaintEventArgs)
  147. MyBase.OnPaint(e)
  148. Dim r2 As New Rectangle(2, 0, Width - 1, 11)
  149. Dim r3 As New Rectangle(2, 0, Width - 1, 11)
  150. e.Graphics.Clear(Color.FromArgb(24, 24, 24))
  151. Dim ItemBounds As Rectangle
  152. Dim TextBrush As New SolidBrush(Color.Empty)
  153. Dim TabBrush As New SolidBrush(Color.Lime)
  154. e.Graphics.FillRectangle(New SolidBrush(Color.FromArgb(24, 24, 24)), New Rectangle(1, 1, Width - 2, Height - 2))
  155. DrawGradientBrush2 = New LinearGradientBrush(r3, Color.FromArgb(62, Color.White), Color.FromArgb(30, Color.White), 90S)
  156. e.Graphics.FillRectangle(DrawGradientBrush2, r2)
  157. For TabItemIndex As Integer = 0 To Me.TabCount - 1
  158. ItemBounds = Me.GetTabRect(TabItemIndex)
  159.  
  160. If CBool(TabItemIndex And 1) Then
  161. TabBrush.Color = Color.Transparent
  162. Else
  163. TabBrush.Color = Color.Transparent
  164. End If
  165. e.Graphics.FillRectangle(TabBrush, ItemBounds)
  166. Dim BorderPen As Pen
  167. If TabItemIndex = SelectedIndex Then
  168. BorderPen = New Pen(Color.Transparent, 1)
  169. Else
  170. BorderPen = New Pen(Color.Transparent, 1)
  171. End If
  172. e.Graphics.DrawRectangle(BorderPen, New Rectangle(ItemBounds.Location.X + 3, ItemBounds.Location.Y + 1, ItemBounds.Width - 8, ItemBounds.Height - 4))
  173. BorderPen.Dispose()
  174. Dim sf As New StringFormat
  175. sf.LineAlignment = StringAlignment.Center
  176. sf.Alignment = StringAlignment.Center
  177.  
  178. If Me.SelectedIndex = TabItemIndex Then
  179. TextBrush.Color = TabTextColor
  180. Else
  181. TextBrush.Color = Color.Gray
  182. End If
  183. e.Graphics.DrawString( _
  184. Me.TabPages(TabItemIndex).Text, _
  185. Me.Font, TextBrush, _
  186. RectangleF.op_Implicit(Me.GetTabRect(TabItemIndex)), sf)
  187. Try
  188. Me.TabPages(TabItemIndex).BackColor = Color.FromArgb(34, 34, 34)
  189. Catch
  190. End Try
  191. Next
  192. Try
  193. For Each tabpg As TabPage In Me.TabPages
  194. tabpg.BorderStyle = BorderStyle.None
  195. Next
  196. Catch
  197. End Try
  198. e.Graphics.DrawRectangle(New Pen(New SolidBrush(Color.FromArgb(255, Color.Black))), 2, 0, Width - 3, Height - 3)
  199. e.Graphics.DrawRectangle(New Pen(New SolidBrush(LighterBlack)), New Rectangle(3, 24, Width - 5, Height - 28))
  200. e.Graphics.DrawLine(New Pen(New SolidBrush(Color.FromArgb(255, Color.Black))), 2, 23, Width - 2, 23)
  201. e.Graphics.DrawLine(New Pen(New SolidBrush(Color.FromArgb(35, 35, 35))), 0, 0, 1, 1)
  202. e.Graphics.DrawLine(New Pen(New SolidBrush(Color.FromArgb(70, 70, 70))), 2, Height - 2, Width + 1, Height - 2)
  203.  
  204. End Sub
  205. End Class
  206. Class StyleProgressBar
  207. Inherits ThemeControl153
  208. Private _Maximum As Integer = 100
  209.  
  210.  
  211. Public Property Maximum() As Integer
  212. Get
  213. Return _Maximum
  214. End Get
  215. Set(ByVal value As Integer)
  216. If value < 1 Then value = 1
  217. If value < _Value Then _Value = value
  218. _Maximum = value
  219. Invalidate()
  220. End Set
  221. End Property
  222.  
  223. Private _Value As Integer = 50
  224. Public Property Value() As Integer
  225. Get
  226. Return _Value
  227. End Get
  228. Set(ByVal value As Integer)
  229. If value > _Maximum Then value = _Maximum
  230. _Value = value
  231. Invalidate()
  232. End Set
  233. End Property
  234.  
  235. Private C1 As Color 'G.Clear
  236. Private C2, C3 As Color 'Lime Gradient
  237. Private P1 As Pen 'DrawRectangle
  238. Private B1 As Brush 'Gloss
  239. Sub New()
  240. Size = New Size(75, 18)
  241. End Sub
  242. Protected Overrides Sub ColorHook()
  243. C1 = Color.FromArgb(28, 28, 28)
  244. C2 = Color.FromArgb(102, 200, 7)
  245. C3 = Color.FromArgb(28, 28, 28)
  246. P1 = Pens.Black
  247. B1 = New SolidBrush(Color.FromArgb(50, Color.White))
  248. End Sub
  249.  
  250. Protected Overrides Sub PaintHook()
  251. G.Clear(C1)
  252. If (_Value > 0) Then
  253.  
  254. DrawGradient(C2, C3, 0, 0, CInt((_Value / _Maximum) * Width), Height, 90S)
  255. Dim T As New HatchBrush(HatchStyle.DarkDownwardDiagonal, Color.FromArgb(65, 3, 35, 58), Color.Empty)
  256. G.FillRectangle(T, New Rectangle(0, 0, CInt((_Value / _Maximum) * Width), Height))
  257.  
  258. End If
  259. G.FillRectangle(B1, 0, 0, Width, CInt(Height / 2))
  260. DrawBorders(P1, 0, 0, Width, Height)
  261. End Sub
  262. End Class
  263. Class StyleCheckBox
  264. Inherits ThemeControl153
  265. Private C1 As Color 'G.Clear
  266. Private C2, C3 As Color 'Lime Gradient
  267. Private P1 As Pen 'DrawRectangle
  268. Private B1 As Brush 'Gloss
  269. Private B2 As Brush 'DrawText
  270. Private B3 As Brush 'Fill
  271.  
  272. Private _Checked As Boolean = False
  273. Public Property Checked() As Boolean
  274. Get
  275. Return _Checked
  276. End Get
  277. Set(ByVal checked As Boolean)
  278. _Checked = checked
  279. Invalidate()
  280. End Set
  281. End Property
  282. Sub New()
  283. Size = New Size(136, 20)
  284. End Sub
  285. Sub changeChecked() Handles Me.Click
  286. Select Case _Checked
  287. Case False
  288. _Checked = True
  289. Case True
  290. _Checked = False
  291. End Select
  292. End Sub
  293. Protected Overrides Sub ColorHook()
  294. C1 = Color.FromArgb(38, 38, 38)
  295. C2 = Color.Black
  296. C3 = Color.Lime
  297. P1 = Pens.Black
  298. B1 = New SolidBrush(Color.FromArgb(15, Color.Lime))
  299. B2 = New SolidBrush(Color.White)
  300. B3 = New SolidBrush(Color.FromArgb(24, 24, 24))
  301.  
  302. End Sub
  303.  
  304. Protected Overrides Sub PaintHook()
  305. G.Clear(C1)
  306.  
  307. G.FillRectangle(B3, 0, 0, 15, 15)
  308. G.DrawRectangle(P1, 0, 0, 15, 15)
  309.  
  310. If (_Checked = False) Then
  311. If (State = MouseState.Over) Then
  312. DrawGradient(Color.FromArgb(50, 50, 50), Color.FromArgb(15, 15, 15), 2, 2, 11, 11, 90S)
  313. Else
  314. DrawGradient(Color.FromArgb(15, 15, 15), Color.FromArgb(50, 50, 50), 2, 2, 11, 11, 90S)
  315. End If
  316. Else
  317. If (State = MouseState.Over) Then
  318. DrawGradient(C3, C2, 2, 2, 11, 11, 90S)
  319. Else
  320. DrawGradient(C2, C3, 2, 2, 11, 11, 90S)
  321. End If
  322.  
  323. End If
  324. G.FillRectangle(B1, 2, 2, 11, 11)
  325. G.DrawRectangle(P1, 2, 2, 11, 11)
  326. DrawText(B2, HorizontalAlignment.Left, 15, 0)
  327. End Sub
  328. End Class
  329.  
  330.  
Add Comment
Please, Sign In to add comment