[VB.NET] Genesis Theme


SUBMITTED BY: eddysix

DATE: March 13, 2017, 8:20 a.m.

FORMAT: VB.net

SIZE: 23.1 kB

HITS: 459

  1. Imports System.Drawing.Drawing2D
  2. Imports System.ComponentModel
  3. Class genesisTheme
  4. Inherits ThemeContainer151
  5. Sub New()
  6. TransparencyKey = Color.Fuchsia
  7. SetColor("BackColor", Color.FromArgb(33, 33, 33))
  8. SetColor("BorderColor", Color.Black)
  9. SetColor("InsetBorderColor", Color.FromArgb(72, 72, 72))
  10. SetColor("TextColor", Color.White)
  11. SetColor("TopGloss", Color.FromArgb(62, Color.White))
  12. SetColor("BottomGloss", Color.FromArgb(30, Color.White))
  13. BackColor = Color.FromArgb(33, 33, 33)
  14. ForeColor = Color.White
  15. Sizable = False
  16. _ShowIcon = False
  17. End Sub
  18. Dim C1, C2, C3, C4, C5, C6 As Color
  19. Protected Overrides Sub ColorHook()
  20. C1 = GetColor("BackColor")
  21. C2 = GetColor("BorderColor")
  22. C3 = GetColor("InsetBorderColor")
  23. C4 = GetColor("TextColor")
  24. C5 = GetColor("TopGloss")
  25. C6 = GetColor("BottomGloss")
  26. End Sub
  27. Protected Overrides Sub PaintHook()
  28. G.Clear(Color.FromArgb(33, 33, 33))
  29. G.FillRectangle(New SolidBrush(C1), New Rectangle(1, 1, Width - 2, Height - 2))
  30. DrawBorders(New Pen(New SolidBrush(C3)), 1)
  31. DrawGradient(C5, C6, New Rectangle(1, 1, Width - 2, 13), 90S)
  32. DrawBorders(New Pen(New SolidBrush(C2)))
  33. DrawCorners(TransparencyKey)
  34. Select Case _ShowIcon
  35. Case True
  36. If Not _Icon Is Nothing Then
  37. G.DrawIcon(_Icon, New Rectangle(8, 6, 12, 12))
  38. End If
  39. DrawText(New SolidBrush(C4), HorizontalAlignment.Left, 24, 0)
  40. Case False
  41. DrawText(New SolidBrush(C4), HorizontalAlignment.Left, 8, 0)
  42. End Select
  43. End Sub
  44. Private _ShowIcon As Boolean
  45. Public Property ShowIcon() As Boolean
  46. Get
  47. Return _ShowIcon
  48. End Get
  49. Set(ByVal v As Boolean)
  50. _ShowIcon = v
  51. Invalidate()
  52. End Set
  53. End Property
  54. Private _Icon As Icon
  55. Public Property Icon() As Icon
  56. Get
  57. Return _Icon
  58. End Get
  59. Set(ByVal v As Icon)
  60. _Icon = v
  61. Invalidate()
  62. End Set
  63. End Property
  64. End Class
  65. Class genesisButton
  66. Inherits ThemeControl151
  67. Sub New()
  68. BackColor = Color.FromArgb(33, 33, 33)
  69. SetColor("ButtonFillColor", Color.FromArgb(47, 47, 47))
  70. SetColor("ButtonClickColor", Color.FromArgb(44, 44, 44))
  71. SetColor("InsetBorderColor", Color.FromArgb(72, 72, 72))
  72. SetColor("TopGloss", Color.FromArgb(62, Color.White))
  73. SetColor("BottomGloss", Color.FromArgb(30, Color.White))
  74. SetColor("TopInset", Color.FromArgb(45, 45, 45))
  75. SetColor("BottomInset", Color.FromArgb(70, 70, 70))
  76. SetColor("BorderColor", Color.Black)
  77. SetColor("TextColor", Color.White)
  78. End Sub
  79. Dim C1, C2, C3, C4, C5, C6, C7, C8, C9 As Color
  80. Protected Overrides Sub ColorHook()
  81. C1 = GetColor("ButtonFillColor")
  82. C2 = GetColor("InsetBorderColor")
  83. C3 = GetColor("TopGloss")
  84. C4 = GetColor("BottomGloss")
  85. C5 = GetColor("TopInset")
  86. C6 = GetColor("BottomInset")
  87. C7 = GetColor("BorderColor")
  88. C8 = GetColor("TextColor")
  89. C9 = GetColor("ButtonClickColor")
  90. End Sub
  91. Protected Overrides Sub PaintHook()
  92. G.Clear(BackColor)
  93. Select Case State
  94. Case 0
  95. G.FillRectangle(New SolidBrush(C1), New Rectangle(1, 1, Width - 2, Height - 2))
  96. DrawBorders(New Pen(New SolidBrush(C2)), 2)
  97. DrawGradient(C3, C4, New Rectangle(1, 1, Width - 2, Height / 2 - 2), 90S)
  98. Case 1
  99. G.FillRectangle(New SolidBrush(C1), New Rectangle(1, 1, Width - 2, Height - 2))
  100. DrawBorders(New Pen(New SolidBrush(C2)), 2)
  101. DrawGradient(C3, C4, New Rectangle(1, 1, Width - 2, Height / 2 - 2), 90S)
  102. Case 2
  103. G.FillRectangle(New SolidBrush(C9), New Rectangle(1, 1, Width - 2, Height - 2))
  104. DrawBorders(New Pen(New SolidBrush(C2)), 2)
  105. DrawGradient(C4, C4, New Rectangle(1, 1, Width - 2, Height / 2 - 2), 90S)
  106. End Select
  107. DrawBorders(New Pen(New SolidBrush(C7)), 1)
  108. G.DrawLine(New Pen(New SolidBrush(C5)), 0, 0, Width, 0)
  109. G.DrawLine(New Pen(New SolidBrush(C5)), 0, 0, 0, Height)
  110. G.DrawLine(New Pen(New SolidBrush(C5)), Width - 1, 0, Width - 1, Height)
  111. G.DrawLine(New Pen(New SolidBrush(C6)), 0, Height - 1, Width, Height - 1)
  112. DrawCorners(BackColor)
  113. DrawCorners(BackColor, New Rectangle(1, 1, Width - 2, Height - 2))
  114. DrawText(New SolidBrush(C8), HorizontalAlignment.Center, 0, 0)
  115. End Sub
  116. End Class
  117. Class genesisTopButton
  118. Inherits ThemeControl151
  119. Sub New()
  120. BackColor = Color.FromArgb(33, 33, 33)
  121. Size = New Size(20, 20)
  122. LockHeight = 20
  123. LockWidth = 20
  124. SetColor("BackColor", Color.FromArgb(47, 47, 47))
  125. SetColor("BorderColor", Color.FromArgb(70, 70, 70))
  126. SetColor("InsetBorderColor2", Color.FromArgb(72, 72, 72))
  127. SetColor("InsetBorderColor", Color.Black)
  128. SetColor("TopGloss", Color.FromArgb(62, Color.White))
  129. SetColor("BottomGloss", Color.FromArgb(30, Color.White))
  130. SetColor("TopInset", Color.FromArgb(45, 45, 45))
  131. SetColor("ButtonClickColor", Color.FromArgb(44, 44, 44))
  132. End Sub
  133. Dim C1, C2, C3, C4, C5, C6, C7, C8 As Color
  134. Protected Overrides Sub ColorHook()
  135. C1 = GetColor("BackColor")
  136. C2 = GetColor("InsetBorderColor2")
  137. C3 = GetColor("TopGloss")
  138. C4 = GetColor("BottomGloss")
  139. C5 = GetColor("BorderColor")
  140. C6 = GetColor("InsetBorderColor")
  141. C7 = GetColor("TopInset")
  142. C8 = GetColor("ButtonClickColor")
  143. End Sub
  144. Protected Overrides Sub PaintHook()
  145. G.Clear(BackColor)
  146. Select Case State
  147. Case 0
  148. G.FillRectangle(New SolidBrush(C1), New Rectangle(1, 1, Width - 2, Height - 2))
  149. DrawBorders(New Pen(New SolidBrush(C2)), 2)
  150. DrawGradient(C3, C4, New Rectangle(1, 1, Width - 2, Height / 2 - 2), 90S)
  151. Case 1
  152. G.FillRectangle(New SolidBrush(C1), New Rectangle(1, 1, Width - 2, Height - 2))
  153. DrawBorders(New Pen(New SolidBrush(C2)), 2)
  154. DrawGradient(C3, C4, New Rectangle(1, 1, Width - 2, Height / 2 - 2), 90S)
  155. Case 2
  156. G.FillRectangle(New SolidBrush(C8), New Rectangle(1, 1, Width - 2, Height - 2))
  157. DrawBorders(New Pen(New SolidBrush(C2)), 2)
  158. DrawGradient(C4, C4, New Rectangle(1, 1, Width - 2, Height / 2 - 2), 90S)
  159. End Select
  160. DrawBorders(New Pen(New SolidBrush(C6)), 1)
  161. DrawBorders(New Pen(New SolidBrush(C5)))
  162. G.DrawLine(New Pen(New SolidBrush(C7)), 0, Height \ 2, 0, Height)
  163. G.DrawLine(New Pen(New SolidBrush(C7)), Width - 1, Height \ 2, Width - 1, Height)
  164. DrawCorners(BackColor, New Rectangle(1, 1, Width - 2, Height - 2))
  165. End Sub
  166. End Class
  167. Class genesisTextBox
  168. Inherits ThemeControl151
  169. Dim WithEvents txtbox As New TextBox
  170. Private _PassMask As Boolean
  171. Public Property UsePasswordMask() As Boolean
  172. Get
  173. Return _PassMask
  174. End Get
  175. Set(ByVal v As Boolean)
  176. _PassMask = v
  177. Invalidate()
  178. End Set
  179. End Property
  180. Private _maxchars As Integer
  181. Public Property MaxCharacters() As Integer
  182. Get
  183. Return _maxchars
  184. End Get
  185. Set(ByVal v As Integer)
  186. _maxchars = v
  187. End Set
  188. End Property
  189. Sub New()
  190. txtbox.TextAlign = HorizontalAlignment.Center
  191. txtbox.BorderStyle = BorderStyle.None
  192. txtbox.Location = New Point(5, 6)
  193. txtbox.Font = New Font("Verdana", 7.25)
  194. Controls.Add(txtbox)
  195. BackColor = Color.FromArgb(37, 37, 37)
  196. Text = ""
  197. txtbox.Text = ""
  198. Me.Size = New Size(135, 35)
  199. SetColor("BackColor", Color.FromArgb(37, 37, 37))
  200. SetColor("TextColor", Color.White)
  201. SetColor("TopInset", Color.FromArgb(45, 45, 45))
  202. SetColor("BottomInset", Color.FromArgb(70, 70, 70))
  203. SetColor("TextBoxShadow", Color.FromArgb(31, 31, 31))
  204. SetColor("BorderColor", Color.Black)
  205. End Sub
  206. Dim C1, C2, C3, C4, C5, C6 As Color
  207. Protected Overrides Sub ColorHook()
  208. C1 = GetColor("BackColor")
  209. C2 = GetColor("TextColor")
  210. C3 = GetColor("TopInset")
  211. C4 = GetColor("BottomInset")
  212. C5 = GetColor("TextBoxShadow")
  213. C6 = GetColor("BorderColor")
  214. txtbox.ForeColor = C2
  215. txtbox.BackColor = C1
  216. End Sub
  217. Protected Overrides Sub PaintHook()
  218. G.Clear(BackColor)
  219. Select Case UsePasswordMask
  220. Case True
  221. txtbox.UseSystemPasswordChar = True
  222. Case False
  223. txtbox.UseSystemPasswordChar = False
  224. End Select
  225. Size = New Size(Me.Width, 25)
  226. txtbox.Font = Font
  227. txtbox.Size = New Size(Me.Width - 10, txtbox.Height - 10)
  228. txtbox.MaxLength = MaxCharacters
  229. G.FillRectangle(New SolidBrush(C1), New Rectangle(1, 1, Width - 2, Height - 2))
  230. DrawBorders(New Pen(New SolidBrush(C6)), 1)
  231. DrawBorders(New Pen(New SolidBrush(C4)))
  232. G.DrawLine(New Pen(New SolidBrush(C3)), 0, 0, Width, 0)
  233. G.DrawLine(New Pen(New SolidBrush(C3)), 0, 0, 0, Height)
  234. G.DrawLine(New Pen(New SolidBrush(C3)), Width - 1, 0, Width - 1, Height)
  235. G.DrawLine(New Pen(New SolidBrush(C5)), 2, 2, Width - 3, 2)
  236. DrawCorners(BackColor)
  237. DrawCorners(BackColor, New Rectangle(1, 1, Width - 2, Height - 2))
  238. End Sub
  239. Sub TextChngTxtBox() Handles txtbox.TextChanged
  240. Text = txtbox.Text
  241. End Sub
  242. Sub TextChng() Handles MyBase.TextChanged
  243. txtbox.Text = Text
  244. End Sub
  245. End Class
  246. <DefaultEvent("CheckedChanged")> _
  247. Class genesisCheckBox
  248. Inherits ThemeControl151
  249. Sub New()
  250. BackColor = Color.FromArgb(37, 37, 37)
  251. LockWidth = 50
  252. LockHeight = 20
  253. Checked = False
  254. SetColor("OnGradientA", Color.FromArgb(63, 83, 100))
  255. SetColor("OnGradientB", Color.FromArgb(87, 127, 151))
  256. SetColor("OffGradientA", Color.FromArgb(23, 23, 23))
  257. SetColor("OffGradientB", Color.FromArgb(33, 33, 33))
  258. SetColor("SwitchColor", Color.FromArgb(25, 25, 25))
  259. SetColor("TopGloss", Color.FromArgb(62, Color.White))
  260. SetColor("BottomGloss", Color.FromArgb(30, Color.White))
  261. SetColor("SwitchBorder", Color.Black)
  262. SetColor("SwitchInsetBorder", Color.FromArgb(47, 47, 47))
  263. SetColor("BorderColor", Color.Black)
  264. SetColor("TopInset", Color.FromArgb(45, 45, 45))
  265. SetColor("BottomInset", Color.FromArgb(70, 70, 70))
  266. End Sub
  267. Dim C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, C11, C12 As Color
  268. Protected Overrides Sub ColorHook()
  269. C1 = GetColor("OnGradientA")
  270. C2 = GetColor("OnGradientB")
  271. C3 = GetColor("OffGradientA")
  272. C4 = GetColor("OffGradientB")
  273. C5 = GetColor("SwitchColor")
  274. C6 = GetColor("TopGloss")
  275. C7 = GetColor("BottomGloss")
  276. C8 = GetColor("SwitchBorder")
  277. C9 = GetColor("SwitchInsetBorder")
  278. C10 = GetColor("BorderColor")
  279. C11 = GetColor("TopInset")
  280. C12 = GetColor("BottomInset")
  281. End Sub
  282. Protected Overrides Sub PaintHook()
  283. G.Clear(BackColor)
  284. Select Case Checked
  285. Case True
  286. DrawGradient(C1, C2, ClientRectangle, 90S)
  287. G.FillRectangle(New SolidBrush(C5), New Rectangle(Width - 19, 1, 17, Height - 4))
  288. G.DrawRectangle(New Pen(New SolidBrush(C8)), New Rectangle(Width - 20, 0, 20, Height - 1))
  289. G.DrawRectangle(New Pen(New SolidBrush(C9)), New Rectangle(Width - 19, 1, 16, Height - 4))
  290. DrawGradient(C6, C7, New Rectangle(Width - 19, 2, 17, Height / 2 - 2), 90S)
  291. G.DrawString("ON", Font, Brushes.White, 6, 3)
  292. Case False
  293. DrawGradient(C3, C4, ClientRectangle, 90S)
  294. G.FillRectangle(New SolidBrush(C5), New Rectangle(1, 1, 20, Height - 1))
  295. G.DrawRectangle(New Pen(New SolidBrush(C8)), New Rectangle(0, 0, 20, Height - 1))
  296. G.DrawRectangle(New Pen(New SolidBrush(C9)), New Rectangle(2, 2, 17, Height - 5))
  297. DrawGradient(C6, C7, New Rectangle(1, 1, 19, Height / 2 - 2), 90S)
  298. G.DrawString("OFF", Font, Brushes.White, 22, 3)
  299. End Select
  300. DrawCorners(BackColor, New Rectangle(1, 2, Width - 1, Height - 4))
  301. G.DrawLine(New Pen(New SolidBrush(C11)), 0, 0, Width, 0)
  302. G.DrawLine(New Pen(New SolidBrush(C11)), 0, 0, 0, Height)
  303. G.DrawLine(New Pen(New SolidBrush(C11)), Width - 1, 0, Width - 1, Height)
  304. G.DrawLine(New Pen(New SolidBrush(C12)), 0, Height - 1, Width, Height - 1)
  305. DrawBorders(New Pen(New SolidBrush(C10)), 1)
  306. DrawCorners(BackColor)
  307. End Sub
  308. Private _Checked As Boolean
  309. Property Checked() As Boolean
  310. Get
  311. Return _Checked
  312. End Get
  313. Set(ByVal value As Boolean)
  314. _Checked = value
  315. Invalidate()
  316. End Set
  317. End Property
  318. Protected Overrides Sub OnClick(ByVal e As System.EventArgs)
  319. _Checked = Not _Checked
  320. RaiseEvent CheckedChanged(Me)
  321. MyBase.OnClick(e)
  322. End Sub
  323. Event CheckedChanged(ByVal sender As Object)
  324. End Class
  325. Class genesisTabControl
  326. Inherits TabControl
  327. Private LightBlack As Color = Color.FromArgb(37, 37, 37)
  328. Private LighterBlack As Color = Color.FromArgb(44, 44, 44)
  329. Private DrawGradientBrush, DrawGradientBrush2 As LinearGradientBrush
  330. Private _ControlBColor As Color
  331. Public Property TabTextColor() As Color
  332. Get
  333. Return _ControlBColor
  334. End Get
  335. Set(ByVal v As Color)
  336. _ControlBColor = v
  337. Invalidate()
  338. End Set
  339. End Property
  340. Sub New()
  341. MyBase.New()
  342. SetStyle(ControlStyles.AllPaintingInWmPaint Or _
  343. ControlStyles.ResizeRedraw Or _
  344. ControlStyles.UserPaint Or _
  345. ControlStyles.DoubleBuffer, True)
  346. TabTextColor = Color.White
  347. End Sub
  348. Protected Overrides Sub OnPaint(ByVal e As PaintEventArgs)
  349. MyBase.OnPaint(e)
  350. Dim r2 As New Rectangle(2, 0, Width - 1, 11)
  351. Dim r3 As New Rectangle(2, 0, Width - 1, 11)
  352. e.Graphics.Clear(Color.FromArgb(37, 37, 37))
  353. Dim ItemBounds As Rectangle
  354. Dim TextBrush As New SolidBrush(Color.Empty)
  355. Dim TabBrush As New SolidBrush(Color.DimGray)
  356. e.Graphics.FillRectangle(New SolidBrush(Color.FromArgb(33, 33, 33)), New Rectangle(1, 1, Width - 2, Height - 2))
  357. DrawGradientBrush2 = New LinearGradientBrush(r3, Color.FromArgb(62, Color.White), Color.FromArgb(30, Color.White), 90S)
  358. e.Graphics.FillRectangle(DrawGradientBrush2, r2)
  359. For TabItemIndex As Integer = 0 To Me.TabCount - 1
  360. ItemBounds = Me.GetTabRect(TabItemIndex)
  361. If CBool(TabItemIndex And 1) Then
  362. TabBrush.Color = Color.Transparent
  363. Else
  364. TabBrush.Color = Color.Transparent
  365. End If
  366. e.Graphics.FillRectangle(TabBrush, ItemBounds)
  367. Dim BorderPen As Pen
  368. If TabItemIndex = SelectedIndex Then
  369. BorderPen = New Pen(Color.Transparent, 1)
  370. Else
  371. BorderPen = New Pen(Color.Transparent, 1)
  372. End If
  373. e.Graphics.DrawRectangle(BorderPen, New Rectangle(ItemBounds.Location.X + 3, ItemBounds.Location.Y + 1, ItemBounds.Width - 8, ItemBounds.Height - 4))
  374. BorderPen.Dispose()
  375. Dim sf As New StringFormat
  376. sf.LineAlignment = StringAlignment.Center
  377. sf.Alignment = StringAlignment.Center
  378. If Me.SelectedIndex = TabItemIndex Then
  379. TextBrush.Color = TabTextColor
  380. Else
  381. TextBrush.Color = Color.DimGray
  382. End If
  383. e.Graphics.DrawString( _
  384. Me.TabPages(TabItemIndex).Text, _
  385. Me.Font, TextBrush, _
  386. RectangleF.op_Implicit(Me.GetTabRect(TabItemIndex)), sf)
  387. Try
  388. Me.TabPages(TabItemIndex).BackColor = Color.FromArgb(35, 35, 35)
  389. Catch
  390. End Try
  391. Next
  392. Try
  393. For Each tabpg As TabPage In Me.TabPages
  394. tabpg.BorderStyle = BorderStyle.None
  395. Next
  396. Catch
  397. End Try
  398. e.Graphics.DrawRectangle(New Pen(New SolidBrush(Color.FromArgb(255, Color.Black))), 2, 0, Width - 3, Height - 3)
  399. e.Graphics.DrawRectangle(New Pen(New SolidBrush(LighterBlack)), New Rectangle(3, 24, Width - 5, Height - 28))
  400. e.Graphics.DrawLine(New Pen(New SolidBrush(Color.FromArgb(255, Color.Black))), 2, 23, Width - 2, 23)
  401. e.Graphics.DrawLine(New Pen(New SolidBrush(Color.FromArgb(35, 35, 35))), 0, 0, 1, 1)
  402. e.Graphics.DrawLine(New Pen(New SolidBrush(Color.FromArgb(70, 70, 70))), 2, Height - 2, Width + 1, Height - 2)
  403. End Sub
  404. End Class
  405. Class genesisComboBox
  406. Inherits ComboBox
  407. Sub New()
  408. MyBase.New()
  409. SetStyle(ControlStyles.AllPaintingInWmPaint Or _
  410. ControlStyles.ResizeRedraw Or _
  411. ControlStyles.UserPaint Or _
  412. ControlStyles.DoubleBuffer, True)
  413. DrawMode = Windows.Forms.DrawMode.OwnerDrawFixed
  414. BackColor = Color.FromArgb(45, 45, 45)
  415. ForeColor = Color.White
  416. DropDownStyle = ComboBoxStyle.DropDownList
  417. End Sub
  418. Private _StartIndex As Integer = 0
  419. Public Property StartIndex As Integer
  420. Get
  421. Return _StartIndex
  422. End Get
  423. Set(ByVal value As Integer)
  424. _StartIndex = value
  425. Try
  426. MyBase.SelectedIndex = value
  427. Catch
  428. End Try
  429. Invalidate()
  430. End Set
  431. End Property
  432. Private LightBlack As Color = Color.FromArgb(37, 37, 37)
  433. Private LighterBlack As Color = Color.FromArgb(60, 60, 60)
  434. Protected Overrides Sub OnPaint(ByVal e As PaintEventArgs)
  435. MyBase.OnPaint(e)
  436. Dim G As Graphics = e.Graphics
  437. Dim T As LinearGradientBrush = New LinearGradientBrush(New Rectangle(0, 0, Width, 10), Color.FromArgb(62, Color.White), Color.FromArgb(30, Color.White), 90S)
  438. Dim DrawCornersBrush As SolidBrush
  439. DrawCornersBrush = New SolidBrush(Color.FromArgb(37, 37, 37))
  440. Try
  441. With G
  442. G.SmoothingMode = SmoothingMode.HighQuality
  443. .Clear(Color.FromArgb(37, 37, 37))
  444. .FillRectangle(T, New Rectangle(0, 0, Width, 9))
  445. .DrawString(Items(SelectedIndex).ToString, Font, Brushes.White, New Point(3, 3))
  446. .DrawLine(New Pen(New SolidBrush(Color.FromArgb(37, 37, 37))), 0, 0, 0, 0)
  447. .DrawRectangle(New Pen(New SolidBrush(Color.FromArgb(0, 0, 0))), New Rectangle(1, 1, Width - 3, Height - 3))
  448. .DrawLine(New Pen(New SolidBrush(Color.FromArgb(45, 45, 45))), 0, 0, Width, 0)
  449. .DrawLine(New Pen(New SolidBrush(Color.FromArgb(45, 45, 45))), 0, 0, 0, Height)
  450. .DrawLine(New Pen(New SolidBrush(Color.FromArgb(45, 45, 45))), Width - 1, 0, Width - 1, Height)
  451. .DrawLine(New Pen(New SolidBrush(Color.FromArgb(70, 70, 70))), 0, Height - 1, Width, Height - 1)
  452. DrawTriangle(Color.White, New Point(Width - 15, 8), New Point(Width - 7, 8), New Point(Width - 11, 13), G)
  453. End With
  454. Catch
  455. End Try
  456. End Sub
  457. Sub ReplaceItem(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DrawItemEventArgs) Handles Me.DrawItem
  458. e.DrawBackground()
  459. Try
  460. If (e.State And DrawItemState.Selected) = DrawItemState.Selected Then
  461. e.Graphics.FillRectangle(New SolidBrush(Color.FromArgb(37, 37, 37)), e.Bounds)
  462. End If
  463. Using b As New SolidBrush(e.ForeColor)
  464. e.Graphics.DrawString(MyBase.GetItemText(MyBase.Items(e.Index)), e.Font, b, e.Bounds)
  465. End Using
  466. Catch
  467. End Try
  468. e.DrawFocusRectangle()
  469. End Sub
  470. Protected Sub DrawTriangle(ByVal Clr As Color, ByVal FirstPoint As Point, ByVal SecondPoint As Point, ByVal ThirdPoint As Point, ByVal G As Graphics)
  471. Dim points As New List(Of Point)()
  472. points.Add(FirstPoint)
  473. points.Add(SecondPoint)
  474. points.Add(ThirdPoint)
  475. G.FillPolygon(New SolidBrush(Clr), points.ToArray)
  476. End Sub
  477. End Class
  478. Class genesisGroupBox
  479. Inherits ThemeContainer151
  480. Sub New()
  481. ControlMode = True
  482. Dock = DockStyle.None
  483. Size = New Size(180, 200)
  484. BackColor = Color.FromArgb(37, 37, 37)
  485. SetColor("BackColor", Color.FromArgb(37, 37, 37))
  486. SetColor("HeaderColor", Color.FromArgb(32, 32, 32))
  487. SetColor("TextColor", Color.White)
  488. SetColor("BorderColor", Color.Black)
  489. SetColor("TopInset", Color.FromArgb(45, 45, 45))
  490. SetColor("BottomInset", Color.FromArgb(70, 70, 70))
  491. End Sub
  492. Dim C1, C2, C3, C4, C5, C6 As Color
  493. Protected Overrides Sub ColorHook()
  494. C1 = GetColor("BackColor")
  495. C2 = GetColor("HeaderColor")
  496. C3 = GetColor("TextColor")
  497. C4 = GetColor("BorderColor")
  498. C5 = GetColor("TopInset")
  499. C6 = GetColor("BottomInset")
  500. End Sub
  501. Protected Overrides Sub PaintHook()
  502. G.Clear(Color.FromArgb(37, 37, 37))
  503. G.FillRectangle(New SolidBrush(C1), New Rectangle(1, 1, Width - 2, Height - 2))
  504. G.FillRectangle(New SolidBrush(C2), New Rectangle(1, 1, Width - 2, 20))
  505. G.DrawLine(Pens.Black, 0, 21, Width, 21)
  506. G.DrawLine(New Pen(New SolidBrush(C5)), 0, 22, Width, 22)
  507. DrawBorders(New Pen(New SolidBrush(C4)), 1)
  508. DrawBorders(New Pen(New SolidBrush(C6)))
  509. G.DrawLine(New Pen(New SolidBrush(C5)), 0, 0, Width, 0)
  510. G.DrawLine(New Pen(New SolidBrush(C5)), 0, 0, 0, Height)
  511. G.DrawLine(New Pen(New SolidBrush(C5)), Width - 1, 0, Width - 1, Height)
  512. DrawCorners(BackColor)
  513. DrawCorners(BackColor, New Rectangle(1, 1, Width - 2, Height - 2))
  514. DrawText(New SolidBrush(C3), HorizontalAlignment.Center, 0, 0)
  515. End Sub
  516. End Class

comments powered by Disqus