Advertisement
OverKiller

EletricTheme1 OVERKILLER

Mar 31st, 2012
324
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 20.88 KB | None | 0 0
  1. 'Overkiller Injector Custom Tutorial'
  2. 'EletricTheme1 Test'
  3. 'GoldenArmy OK'
  4.  
  5. Imports System.Drawing.Drawing2D
  6. Imports System.ComponentModel
  7. Imports System.Runtime.InteropServices
  8.  
  9. MustInherit Class Theme
  10. Inherits ContainerControl
  11.  
  12. #Region " Initialization "
  13.  
  14. Protected G As Graphics
  15. Sub New()
  16. SetStyle(DirectCast(139270, ControlStyles), True)
  17. End Sub
  18.  
  19. Private ParentIsForm As Boolean
  20. Protected Overrides Sub OnHandleCreated(ByVal e As EventArgs)
  21. Dock = DockStyle.Fill
  22. ParentIsForm = TypeOf Parent Is Form
  23. If ParentIsForm Then
  24. If Not _TransparencyKey = Color.Empty Then ParentForm.TransparencyKey = _TransparencyKey
  25. ParentForm.FormBorderStyle = FormBorderStyle.None
  26. End If
  27. MyBase.OnHandleCreated(e)
  28. End Sub
  29.  
  30. Overrides Property Text As String
  31. Get
  32. Return MyBase.Text
  33. End Get
  34. Set(ByVal v As String)
  35. MyBase.Text = v
  36. Invalidate()
  37. End Set
  38. End Property
  39. #End Region
  40.  
  41. #Region " Sizing and Movement "
  42.  
  43. Private _Resizable As Boolean = True
  44. Property Resizable() As Boolean
  45. Get
  46. Return _Resizable
  47. End Get
  48. Set(ByVal value As Boolean)
  49. _Resizable = value
  50. End Set
  51. End Property
  52.  
  53. Private _MoveHeight As Integer = 24
  54. Property MoveHeight() As Integer
  55. Get
  56. Return _MoveHeight
  57. End Get
  58. Set(ByVal v As Integer)
  59. _MoveHeight = v
  60. Header = New Rectangle(7, 7, Width - 14, _MoveHeight - 7)
  61. End Set
  62. End Property
  63.  
  64. Private Flag As IntPtr
  65. Protected Overrides Sub OnMouseDown(ByVal e As MouseEventArgs)
  66. If Not e.Button = MouseButtons.Left Then Return
  67. If ParentIsForm Then If ParentForm.WindowState = FormWindowState.Maximized Then Return
  68.  
  69. If Header.Contains(e.Location) Then
  70. Flag = New IntPtr(2)
  71. ElseIf Current.Position = 0 Or Not _Resizable Then
  72. Return
  73. Else
  74. Flag = New IntPtr(Current.Position)
  75. End If
  76.  
  77. Capture = False
  78. DefWndProc(Message.Create(Parent.Handle, 161, Flag, Nothing))
  79.  
  80. MyBase.OnMouseDown(e)
  81. End Sub
  82.  
  83. Private Structure Pointer
  84. ReadOnly Cursor As Cursor, Position As Byte
  85. Sub New(ByVal c As Cursor, ByVal p As Byte)
  86. Cursor = c
  87. Position = p
  88. End Sub
  89. End Structure
  90.  
  91. Private F1, F2, F3, F4 As Boolean, PTC As Point
  92. Private Function GetPointer() As Pointer
  93. PTC = PointToClient(MousePosition)
  94. F1 = PTC.X < 7
  95. F2 = PTC.X > Width - 7
  96. F3 = PTC.Y < 7
  97. F4 = PTC.Y > Height - 7
  98.  
  99. If F1 And F3 Then Return New Pointer(Cursors.SizeNWSE, 13)
  100. If F1 And F4 Then Return New Pointer(Cursors.SizeNESW, 16)
  101. If F2 And F3 Then Return New Pointer(Cursors.SizeNESW, 14)
  102. If F2 And F4 Then Return New Pointer(Cursors.SizeNWSE, 17)
  103. If F1 Then Return New Pointer(Cursors.SizeWE, 10)
  104. If F2 Then Return New Pointer(Cursors.SizeWE, 11)
  105. If F3 Then Return New Pointer(Cursors.SizeNS, 12)
  106. If F4 Then Return New Pointer(Cursors.SizeNS, 15)
  107. Return New Pointer(Cursors.Default, 0)
  108. End Function
  109.  
  110. Private Current, Pending As Pointer
  111. Private Sub SetCurrent()
  112. Pending = GetPointer()
  113. If Current.Position = Pending.Position Then Return
  114. Current = GetPointer()
  115. Cursor = Current.Cursor
  116. End Sub
  117.  
  118. Protected Overrides Sub OnMouseMove(ByVal e As MouseEventArgs)
  119. If _Resizable Then SetCurrent()
  120. MyBase.OnMouseMove(e)
  121. End Sub
  122.  
  123. Protected Header As Rectangle
  124. Protected Overrides Sub OnSizeChanged(ByVal e As EventArgs)
  125. If Width = 0 OrElse Height = 0 Then Return
  126. Header = New Rectangle(7, 7, Width - 14, _MoveHeight - 7)
  127. Invalidate()
  128. MyBase.OnSizeChanged(e)
  129. End Sub
  130.  
  131. #End Region
  132.  
  133. #Region " Convienence "
  134.  
  135. MustOverride Sub PaintHook()
  136. Protected NotOverridable Overrides Sub OnPaint(ByVal e As PaintEventArgs)
  137. If Width = 0 OrElse Height = 0 Then Return
  138. G = e.Graphics
  139. PaintHook()
  140. End Sub
  141.  
  142. Private _TransparencyKey As Color
  143. Property TransparencyKey() As Color
  144. Get
  145. Return _TransparencyKey
  146. End Get
  147. Set(ByVal v As Color)
  148. _TransparencyKey = v
  149. Invalidate()
  150. End Set
  151. End Property
  152.  
  153. Private _Image As Image
  154. Property Image() As Image
  155. Get
  156. Return _Image
  157. End Get
  158. Set(ByVal value As Image)
  159. _Image = value
  160. Invalidate()
  161. End Set
  162. End Property
  163. ReadOnly Property ImageWidth() As Integer
  164. Get
  165. If _Image Is Nothing Then Return 0
  166. Return _Image.Width
  167. End Get
  168. End Property
  169.  
  170. Private _Size As Size
  171. Private _Rectangle As Rectangle
  172. Private _Gradient As LinearGradientBrush
  173. Private _Brush As SolidBrush
  174.  
  175. Protected Sub DrawCorners(ByVal c As Color, ByVal rect As Rectangle)
  176. _Brush = New SolidBrush(c)
  177. G.FillRectangle(_Brush, rect.X, rect.Y, 1, 1)
  178. G.FillRectangle(_Brush, rect.X + (rect.Width - 1), rect.Y, 1, 1)
  179. G.FillRectangle(_Brush, rect.X, rect.Y + (rect.Height - 1), 1, 1)
  180. G.FillRectangle(_Brush, rect.X + (rect.Width - 1), rect.Y + (rect.Height - 1), 1, 1)
  181. End Sub
  182.  
  183. Protected Sub DrawBorders(ByVal p1 As Pen, ByVal p2 As Pen, ByVal rect As Rectangle)
  184. G.DrawRectangle(p1, rect.X, rect.Y, rect.Width - 1, rect.Height - 1)
  185. G.DrawRectangle(p2, rect.X + 1, rect.Y + 1, rect.Width - 3, rect.Height - 3)
  186. End Sub
  187.  
  188. Protected Sub DrawText(ByVal a As HorizontalAlignment, ByVal c As Color, ByVal x As Integer)
  189. DrawText(a, c, x, 0)
  190. End Sub
  191. Protected Sub DrawText(ByVal a As HorizontalAlignment, ByVal c As Color, ByVal x As Integer, ByVal y As Integer)
  192. If String.IsNullOrEmpty(Text) Then Return
  193. _Size = G.MeasureString(Text, Font).ToSize
  194. _Brush = New SolidBrush(c)
  195.  
  196. Select Case a
  197. Case HorizontalAlignment.Left
  198. G.DrawString(Text, Font, _Brush, x, _MoveHeight \ 2 - _Size.Height \ 2 + y)
  199. Case HorizontalAlignment.Right
  200. G.DrawString(Text, Font, _Brush, Width - _Size.Width - x, _MoveHeight \ 2 - _Size.Height \ 2 + y)
  201. Case HorizontalAlignment.Center
  202. G.DrawString(Text, Font, _Brush, Width \ 2 - _Size.Width \ 2 + x, _MoveHeight \ 2 - _Size.Height \ 2 + y)
  203. End Select
  204. End Sub
  205.  
  206. Protected Sub DrawIcon(ByVal a As HorizontalAlignment, ByVal x As Integer)
  207. DrawIcon(a, x, 0)
  208. End Sub
  209. Protected Sub DrawIcon(ByVal a As HorizontalAlignment, ByVal x As Integer, ByVal y As Integer)
  210. If _Image Is Nothing Then Return
  211. Select Case a
  212. Case HorizontalAlignment.Left
  213. G.DrawImage(_Image, x, _MoveHeight \ 2 - _Image.Height \ 2 + y)
  214. Case HorizontalAlignment.Right
  215. G.DrawImage(_Image, Width - _Image.Width - x, _MoveHeight \ 2 - _Image.Height \ 2 + y)
  216. Case HorizontalAlignment.Center
  217. G.DrawImage(_Image, Width \ 2 - _Image.Width \ 2, _MoveHeight \ 2 - _Image.Height \ 2)
  218. End Select
  219. End Sub
  220.  
  221. Protected Sub DrawGradient(ByVal c1 As Color, ByVal c2 As Color, ByVal x As Integer, ByVal y As Integer, ByVal width As Integer, ByVal height As Integer, ByVal angle As Single)
  222. _Rectangle = New Rectangle(x, y, width, height)
  223. _Gradient = New LinearGradientBrush(_Rectangle, c1, c2, angle)
  224. G.FillRectangle(_Gradient, _Rectangle)
  225. End Sub
  226.  
  227. #End Region
  228.  
  229. End Class
  230. MustInherit Class ThemeControl
  231. Inherits Control
  232.  
  233. #Region " Initialization "
  234.  
  235. Protected G As Graphics, B As Bitmap
  236. Sub New()
  237. SetStyle(DirectCast(139270, ControlStyles), True)
  238. B = New Bitmap(1, 1)
  239. G = Graphics.FromImage(B)
  240. End Sub
  241.  
  242. Sub AllowTransparent()
  243. SetStyle(ControlStyles.Opaque, False)
  244. SetStyle(ControlStyles.SupportsTransparentBackColor, True)
  245. End Sub
  246.  
  247. Overrides Property Text As String
  248. Get
  249. Return MyBase.Text
  250. End Get
  251. Set(ByVal v As String)
  252. MyBase.Text = v
  253. Invalidate()
  254. End Set
  255. End Property
  256. #End Region
  257.  
  258. #Region " Mouse Handling "
  259.  
  260. Protected Enum State As Byte
  261. MouseNone = 0
  262. MouseOver = 1
  263. MouseDown = 2
  264. End Enum
  265.  
  266. Protected MouseState As State
  267. Protected Overrides Sub OnMouseLeave(ByVal e As EventArgs)
  268. ChangeMouseState(State.MouseNone)
  269. MyBase.OnMouseLeave(e)
  270. End Sub
  271. Protected Overrides Sub OnMouseEnter(ByVal e As EventArgs)
  272. ChangeMouseState(State.MouseOver)
  273. MyBase.OnMouseEnter(e)
  274. End Sub
  275. Protected Overrides Sub OnMouseUp(ByVal e As MouseEventArgs)
  276. ChangeMouseState(State.MouseOver)
  277. MyBase.OnMouseUp(e)
  278. End Sub
  279. Protected Overrides Sub OnMouseDown(ByVal e As MouseEventArgs)
  280. If e.Button = MouseButtons.Left Then ChangeMouseState(State.MouseDown)
  281. MyBase.OnMouseDown(e)
  282. End Sub
  283.  
  284. Private Sub ChangeMouseState(ByVal e As State)
  285. MouseState = e
  286. Invalidate()
  287. End Sub
  288.  
  289. #End Region
  290.  
  291. #Region " Convienence "
  292.  
  293. MustOverride Sub PaintHook()
  294. Protected NotOverridable Overrides Sub OnPaint(ByVal e As PaintEventArgs)
  295. If Width = 0 OrElse Height = 0 Then Return
  296. PaintHook()
  297. e.Graphics.DrawImage(B, 0, 0)
  298. End Sub
  299.  
  300. Protected Overrides Sub OnSizeChanged(ByVal e As EventArgs)
  301. If Not Width = 0 AndAlso Not Height = 0 Then
  302. B = New Bitmap(Width, Height)
  303. G = Graphics.FromImage(B)
  304. Invalidate()
  305. End If
  306. MyBase.OnSizeChanged(e)
  307. End Sub
  308.  
  309. Private _NoRounding As Boolean
  310. Property NoRounding() As Boolean
  311. Get
  312. Return _NoRounding
  313. End Get
  314. Set(ByVal v As Boolean)
  315. _NoRounding = v
  316. Invalidate()
  317. End Set
  318. End Property
  319.  
  320. Private _Image As Image
  321. Property Image() As Image
  322. Get
  323. Return _Image
  324. End Get
  325. Set(ByVal value As Image)
  326. _Image = value
  327. Invalidate()
  328. End Set
  329. End Property
  330. ReadOnly Property ImageWidth() As Integer
  331. Get
  332. If _Image Is Nothing Then Return 0
  333. Return _Image.Width
  334. End Get
  335. End Property
  336. ReadOnly Property ImageTop() As Integer
  337. Get
  338. If _Image Is Nothing Then Return 0
  339. Return Height \ 2 - _Image.Height \ 2
  340. End Get
  341. End Property
  342.  
  343. Private _Size As Size
  344. Private _Rectangle As Rectangle
  345. Private _Gradient As LinearGradientBrush
  346. Private _Brush As SolidBrush
  347.  
  348. Protected Sub DrawCorners(ByVal c As Color, ByVal rect As Rectangle)
  349. If _NoRounding Then Return
  350.  
  351. B.SetPixel(rect.X, rect.Y, c)
  352. B.SetPixel(rect.X + (rect.Width - 1), rect.Y, c)
  353. B.SetPixel(rect.X, rect.Y + (rect.Height - 1), c)
  354. B.SetPixel(rect.X + (rect.Width - 1), rect.Y + (rect.Height - 1), c)
  355. End Sub
  356.  
  357. Protected Sub DrawBorders(ByVal p1 As Pen, ByVal p2 As Pen, ByVal rect As Rectangle)
  358. G.DrawRectangle(p1, rect.X, rect.Y, rect.Width - 1, rect.Height - 1)
  359. G.DrawRectangle(p2, rect.X + 1, rect.Y + 1, rect.Width - 3, rect.Height - 3)
  360. End Sub
  361.  
  362. Protected Sub DrawText(ByVal a As HorizontalAlignment, ByVal c As Color, ByVal x As Integer)
  363. DrawText(a, c, x, 0)
  364. End Sub
  365. Protected Sub DrawText(ByVal a As HorizontalAlignment, ByVal c As Color, ByVal x As Integer, ByVal y As Integer)
  366. If String.IsNullOrEmpty(Text) Then Return
  367. _Size = G.MeasureString(Text, Font).ToSize
  368. _Brush = New SolidBrush(c)
  369.  
  370. Select Case a
  371. Case HorizontalAlignment.Left
  372. G.DrawString(Text, Font, _Brush, x, Height \ 2 - _Size.Height \ 2 + y)
  373. Case HorizontalAlignment.Right
  374. G.DrawString(Text, Font, _Brush, Width - _Size.Width - x, Height \ 2 - _Size.Height \ 2 + y)
  375. Case HorizontalAlignment.Center
  376. G.DrawString(Text, Font, _Brush, Width \ 2 - _Size.Width \ 2 + x, Height \ 2 - _Size.Height \ 2 + y)
  377. End Select
  378. End Sub
  379.  
  380. Protected Sub DrawIcon(ByVal a As HorizontalAlignment, ByVal x As Integer)
  381. DrawIcon(a, x, 0)
  382. End Sub
  383. Protected Sub DrawIcon(ByVal a As HorizontalAlignment, ByVal x As Integer, ByVal y As Integer)
  384. If _Image Is Nothing Then Return
  385. Select Case a
  386. Case HorizontalAlignment.Left
  387. G.DrawImage(_Image, x, Height \ 2 - _Image.Height \ 2 + y)
  388. Case HorizontalAlignment.Right
  389. G.DrawImage(_Image, Width - _Image.Width - x, Height \ 2 - _Image.Height \ 2 + y)
  390. Case HorizontalAlignment.Center
  391. G.DrawImage(_Image, Width \ 2 - _Image.Width \ 2, Height \ 2 - _Image.Height \ 2)
  392. End Select
  393. End Sub
  394.  
  395. Protected Sub DrawGradient(ByVal c1 As Color, ByVal c2 As Color, ByVal x As Integer, ByVal y As Integer, ByVal width As Integer, ByVal height As Integer, ByVal angle As Single)
  396. _Rectangle = New Rectangle(x, y, width, height)
  397. _Gradient = New LinearGradientBrush(_Rectangle, c1, c2, angle)
  398. G.FillRectangle(_Gradient, _Rectangle)
  399. End Sub
  400. #End Region
  401.  
  402. End Class
  403. MustInherit Class ThemeContainerControl
  404. Inherits ContainerControl
  405.  
  406. #Region " Initialization "
  407.  
  408. Protected G As Graphics, B As Bitmap
  409. Sub New()
  410. SetStyle(DirectCast(139270, ControlStyles), True)
  411. B = New Bitmap(1, 1)
  412. G = Graphics.FromImage(B)
  413. End Sub
  414.  
  415. Sub AllowTransparent()
  416. SetStyle(ControlStyles.Opaque, False)
  417. SetStyle(ControlStyles.SupportsTransparentBackColor, True)
  418. End Sub
  419.  
  420. #End Region
  421.  
  422. #Region " Convienence "
  423.  
  424. MustOverride Sub PaintHook()
  425. Protected NotOverridable Overrides Sub OnPaint(ByVal e As PaintEventArgs)
  426. If Width = 0 OrElse Height = 0 Then Return
  427. PaintHook()
  428. e.Graphics.DrawImage(B, 0, 0)
  429. End Sub
  430.  
  431. Protected Overrides Sub OnSizeChanged(ByVal e As EventArgs)
  432. If Not Width = 0 AndAlso Not Height = 0 Then
  433. B = New Bitmap(Width, Height)
  434. G = Graphics.FromImage(B)
  435. Invalidate()
  436. End If
  437. MyBase.OnSizeChanged(e)
  438. End Sub
  439.  
  440. Private _NoRounding As Boolean
  441. Property NoRounding() As Boolean
  442. Get
  443. Return _NoRounding
  444. End Get
  445. Set(ByVal v As Boolean)
  446. _NoRounding = v
  447. Invalidate()
  448. End Set
  449. End Property
  450.  
  451. Private _Rectangle As Rectangle
  452. Private _Gradient As LinearGradientBrush
  453.  
  454. Protected Sub DrawCorners(ByVal c As Color, ByVal rect As Rectangle)
  455. If _NoRounding Then Return
  456. B.SetPixel(rect.X, rect.Y, c)
  457. B.SetPixel(rect.X + (rect.Width - 1), rect.Y, c)
  458. B.SetPixel(rect.X, rect.Y + (rect.Height - 1), c)
  459. B.SetPixel(rect.X + (rect.Width - 1), rect.Y + (rect.Height - 1), c)
  460. End Sub
  461.  
  462. Protected Sub DrawBorders(ByVal p1 As Pen, ByVal p2 As Pen, ByVal rect As Rectangle)
  463.  
  464. G.DrawRectangle(p2, rect.X + 1, rect.Y + 1, rect.Width - 3, rect.Height - 3)
  465. End Sub
  466.  
  467. Protected Sub DrawGradient(ByVal c1 As Color, ByVal c2 As Color, ByVal x As Integer, ByVal y As Integer, ByVal width As Integer, ByVal height As Integer, ByVal angle As Single)
  468. _Rectangle = New Rectangle(x, y, width, height)
  469. _Gradient = New LinearGradientBrush(_Rectangle, c1, c2, angle)
  470. G.FillRectangle(_Gradient, _Rectangle)
  471. End Sub
  472. #End Region
  473.  
  474. End Class
  475.  
  476. Class ElectricTheme
  477. Inherits Theme
  478.  
  479. Sub New()
  480. MoveHeight = 20
  481. TransparencyKey = Color.Fuchsia
  482. ForeColor = Color.White
  483. BackColor = Color.FromArgb(22, 84, 107)
  484. Dim F As New Font("Verdana", 7) : Font = F
  485. End Sub
  486.  
  487. Dim BGColor As Color = Color.FromArgb(22, 84, 107) : Dim G1 As Color = Color.FromArgb(43, 136, 170) : Dim G2 As Color = Color.FromArgb(29, 102, 129) : Dim F As Color = Color.Fuchsia
  488. Dim Seperator As Pen = New Pen(Color.FromArgb(7, 65, 86))
  489. Dim B As Pen = Pens.Black
  490.  
  491. Overrides Sub PaintHook()
  492. G.Clear(BGColor) 'Background
  493.  
  494. DrawGradient(G1, G2, 0, 0, Width, 20, 90S) 'Menu Bar
  495. G.DrawLine(Seperator, 0, 20, Width, 20) 'Menu bar seperator line
  496.  
  497. G.DrawRectangle(B, ClientRectangle.X, ClientRectangle.Y, ClientRectangle.Width - 1, ClientRectangle.Height - 1) 'Border
  498. DrawCorners(F, ClientRectangle) 'Form corners
  499.  
  500. DrawText(HorizontalAlignment.Left, ForeColor, 3) 'Menu bar's text
  501. End Sub
  502. End Class
  503.  
  504. Class ElectricButton
  505. Inherits ThemeControl
  506.  
  507. Sub New()
  508. ForeColor = Color.White
  509. End Sub
  510.  
  511. Dim G1 As Color = Color.FromArgb(23, 102, 139) : Dim G2 As Color = Color.FromArgb(12, 77, 103) : Dim G3 As Color = Color.FromArgb(34, 133, 179)
  512. Dim G4 As Color = Color.FromArgb(17, 89, 119) : Dim Bl As Pen = Pens.Black : Dim G5 As Color = Color.FromArgb(28, 107, 144)
  513. Dim N As Color = Color.Navy
  514.  
  515. Overrides Sub PaintHook()
  516. G.Clear(N) 'Temporary, gradient will cover it
  517.  
  518. If MouseState = State.MouseNone Then 'Draws a gradient depending on the mousestate
  519. DrawGradient(G1, G2, 0, 0, Width, Height, 90S)
  520. ElseIf MouseState = State.MouseOver Then
  521. DrawGradient(G3, G5, 0, 0, Width, Height, 90S)
  522. ElseIf MouseState = State.MouseDown Then
  523. DrawGradient(G4, G4, 0, 0, Width, Height, 90S)
  524. End If
  525.  
  526. DrawText(HorizontalAlignment.Center, ForeColor, 0) 'Draws the text...
  527. G.DrawRectangle(Bl, ClientRectangle.X, ClientRectangle.Y, ClientRectangle.Width - 1, ClientRectangle.Height - 1) 'Border
  528. End Sub
  529. End Class
  530.  
  531.  
  532. Class ElectricProgressBar
  533. Inherits ThemeControl
  534.  
  535. Private _Maximum As Integer = 100
  536. Property Maximum() As Integer
  537. Get
  538. Return _Maximum
  539. End Get
  540. Set(ByVal v As Integer)
  541. If v < 1 Then v = 1
  542. If v < _Value Then _Value = v
  543.  
  544. _Maximum = v
  545. Invalidate()
  546. End Set
  547. End Property
  548.  
  549. Private _Value As Integer
  550. Property Value() As Integer
  551. Get
  552. Return _Value
  553. End Get
  554. Set(ByVal v As Integer)
  555. If v > _Maximum Then v = _Maximum
  556.  
  557. _Value = v
  558. Invalidate()
  559. End Set
  560. End Property
  561.  
  562. Sub New()
  563. AllowTransparent()
  564. ForeColor = Color.White
  565. End Sub
  566.  
  567. Dim Border As New Pen(Color.FromArgb(82, 128, 145)) : Dim T As Color = Color.Transparent
  568. Dim BackClr As Color = Color.FromArgb(26, 100, 127) : Dim UpperColor As New SolidBrush(Color.FromArgb(50, 121, 148)) : Dim LowerColor As New SolidBrush(Color.FromArgb(25, 105, 135))
  569.  
  570. Overrides Sub PaintHook()
  571. G.Clear(BackClr)
  572.  
  573. G.FillRectangle(LowerColor, 1, 1, CInt((_Value / _Maximum) * Width), Height - 2) ' \
  574. G.FillRectangle(UpperColor, 1, 1, CInt((_Value / _Maximum) * Width), (Height - 2) \ 2) ' > Draw the colors and the border
  575. G.DrawRectangle(Border, 0, 0, Width - 1, Height - 1) ' /
  576.  
  577. DrawText(HorizontalAlignment.Center, ForeColor, 0)
  578.  
  579. DrawCorners(BackClr, ClientRectangle) 'Corners..
  580. End Sub
  581. End Class
  582.  
  583. Class ElectricSeperator
  584. Inherits ThemeControl
  585.  
  586. Private _Color1 As Color = Color.FromArgb(23, 127, 165)
  587. Public Property Color1() As Color
  588. Get
  589. Return _Color1
  590. End Get
  591. Set(ByVal value As Color)
  592. _Color1 = value
  593. End Set
  594. End Property
  595.  
  596. Private _Color2 As Color = Color.FromArgb(31, 45, 51)
  597. Public Property Color2() As Color
  598. Get
  599. Return _Color2
  600. End Get
  601. Set(ByVal value As Color)
  602. _Color2 = value
  603. End Set
  604. End Property
  605.  
  606. Sub New()
  607. AllowTransparent()
  608. BackColor = Color.Transparent
  609. Dim S As New Size(150, 10) : Size = S
  610. End Sub
  611.  
  612. Overrides Sub PaintHook()
  613. G.Clear(BackColor)
  614.  
  615. G.DrawLine(New Pen(_Color1), 0, Height \ 2, Width, Height \ 2)
  616. G.DrawLine(New Pen(_Color2), 0, Height \ 2 + 1, Width, Height \ 2 + 1)
  617. End Sub
  618. End Class
  619.  
  620. Class ElectricMenuButton
  621. Inherits ThemeControl
  622.  
  623. Sub New()
  624. AllowTransparent()
  625. ForeColor = Color.White
  626. Dim S As New Size(15, 20) : Size = S
  627. End Sub
  628.  
  629. Dim Bl As Pen = Pens.Black
  630. Dim G1 As Color = Color.FromArgb(43, 136, 170) : Dim G2 As Color = Color.FromArgb(29, 102, 129)
  631.  
  632. Overrides Sub PaintHook()
  633. DrawGradient(G1, G2, 0, 0, Width, 20, 90S)
  634. G.DrawLine(Bl, 0, 0, Width, 0)
  635. DrawText(HorizontalAlignment.Center, ForeColor, 0)
  636. End Sub
  637. End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement