Advertisement
xZ3ROxPROJ3CTx

Steam2 VB.net Theme by ZerO

Oct 17th, 2011
8,885
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 6.95 KB | None | 0 0
  1. Imports System.Drawing.Drawing2D
  2.  
  3. Class SteamTheme
  4.     Inherits ThemeContainer153
  5.  
  6.     Sub New()
  7.         ForeColor = Color.FromArgb(195, 193, 191)
  8.     End Sub
  9.  
  10.     Protected Overrides Sub ColorHook()
  11.  
  12.     End Sub
  13.  
  14.     Protected Overrides Sub PaintHook()
  15.         G.Clear(Color.FromArgb(56, 54, 53))
  16.         DrawGradient(Color.Black, Color.FromArgb(76, 108, 139), ClientRectangle, 65S)
  17.         G.FillRectangle(New SolidBrush(Color.FromArgb(56, 54, 53)), New Rectangle(1, 1, Width - 2, Height - 2))
  18.         DrawGradient(Color.FromArgb(71, 68, 66), Color.FromArgb(57, 55, 54), New Rectangle(1, 1, Width - 2, 35), 90S)
  19.         DrawText(New SolidBrush(Color.FromArgb(195, 193, 191)), HorizontalAlignment.Left, 4, 0)
  20.     End Sub
  21. End Class
  22. Class SteamThemeAlt
  23.     Inherits ThemeContainer153
  24.  
  25.     Protected Overrides Sub ColorHook()
  26.  
  27.     End Sub
  28.  
  29.     Protected Overrides Sub PaintHook()
  30.         G.Clear(Color.FromArgb(44, 42, 40))
  31.  
  32.         Dim T As New HatchBrush(HatchStyle.DarkUpwardDiagonal, Color.FromArgb(20, 19, 19), Color.FromArgb(46, 44, 42))
  33.         G.FillRectangle(T, ClientRectangle)
  34.         DrawGradient(Color.Transparent, Color.FromArgb(29, 28, 27), New Rectangle(0, 0 - Height / 3 - Height / 9, Width, Height))
  35.         G.FillRectangle(New SolidBrush(Color.FromArgb(29, 28, 28)), New Rectangle(0, Height / 3 + Height / 3 - Height / 9, Width, Height))
  36.  
  37.  
  38.         DrawBorders(New Pen(New SolidBrush(Color.FromArgb(0, 0, 0))))
  39.         DrawText(New SolidBrush(Color.FromArgb(195, 193, 191)), HorizontalAlignment.Left, 4, 0)
  40.     End Sub
  41. End Class
  42.  
  43. Class SteamButton
  44.     Inherits ThemeControl153
  45.  
  46.     Sub New()
  47.         Font = New Font("Verdana", 7.25)
  48.     End Sub
  49.  
  50.     Protected Overrides Sub ColorHook()
  51.  
  52.     End Sub
  53.  
  54.     Protected Overrides Sub PaintHook()
  55.         G.Clear(Color.FromArgb(56, 54, 53))
  56.         DrawBorders(New Pen(New SolidBrush(Color.FromArgb(77, 75, 72))))
  57.         DrawCorners(Color.FromArgb(56, 54, 53))
  58.         Select Case State
  59.             Case 0
  60.                 DrawGradient(Color.FromArgb(92, 89, 86), Color.FromArgb(74, 72, 70), ClientRectangle, 90S)
  61.                 DrawBorders(New Pen(New SolidBrush(Color.FromArgb(112, 109, 105))))
  62.                 DrawCorners(Color.FromArgb(82, 79, 77))
  63.             Case 1
  64.                 DrawGradient(Color.FromArgb(112, 109, 106), Color.FromArgb(94, 92, 90), ClientRectangle, 90S)
  65.                 DrawBorders(New Pen(New SolidBrush(Color.FromArgb(141, 148, 130))))
  66.                 DrawCorners(Color.FromArgb(82, 79, 77))
  67.             Case 2
  68.                 DrawGradient(Color.FromArgb(56, 54, 53), Color.FromArgb(73, 71, 69), ClientRectangle, 90S)
  69.                 DrawBorders(New Pen(New SolidBrush(Color.FromArgb(112, 109, 105))))
  70.                 DrawCorners(Color.FromArgb(82, 79, 77))
  71.         End Select
  72.         DrawText(New SolidBrush(Color.FromArgb(195, 193, 191)), Text.ToUpper, HorizontalAlignment.Left, 4, 0)
  73.     End Sub
  74. End Class
  75.  
  76. Class SteamSeparator
  77.     Inherits ThemeControl153
  78.  
  79.     Protected Overrides Sub ColorHook()
  80.  
  81.     End Sub
  82.  
  83.     Protected Overrides Sub PaintHook()
  84.         G.FillRectangle(New SolidBrush(Color.FromArgb(56, 54, 53)), ClientRectangle)
  85.         DrawGradient(Color.FromArgb(107, 104, 101), Color.FromArgb(74, 72, 70), New Rectangle(0, Height / 2, Width, 1), 45S)
  86.     End Sub
  87. End Class
  88.  
  89. Class SteamProgressBar
  90.     Inherits ThemeControl153
  91.  
  92.     Private _Maximum As Integer
  93.     Public Property Maximum() As Integer
  94.         Get
  95.             Return _Maximum
  96.         End Get
  97.         Set(ByVal v As Integer)
  98.             Select Case v
  99.                 Case Is < _Value
  100.                     _Value = v
  101.             End Select
  102.             _Maximum = v
  103.             Invalidate()
  104.         End Set
  105.     End Property
  106.     Private _Value As Integer
  107.     Public Property Value() As Integer
  108.         Get
  109.             Select Case _Value
  110.                 Case 0
  111.                     Return 1
  112.                 Case Else
  113.                     Return _Value
  114.             End Select
  115.         End Get
  116.         Set(ByVal v As Integer)
  117.             Select Case v
  118.                 Case Is > _Maximum
  119.                     v = _Maximum
  120.             End Select
  121.             _Value = v
  122.             Invalidate()
  123.         End Set
  124.     End Property
  125.  
  126.     Sub New()
  127.         Transparent = True
  128.         BackColor = Color.Transparent
  129.         LockHeight = 18
  130.         Value = 0
  131.         Maximum = 100
  132.     End Sub
  133.  
  134.     Protected Overrides Sub PaintHook()
  135.         G.Clear(BackColor)
  136.         'Fill
  137.         Select Case _Value
  138.             Case Is > 2
  139.                 G.FillRectangle(New SolidBrush(Color.FromArgb(166, 164, 161)), New Rectangle(4, 4, CInt(_Value / _Maximum * Width) - 8, Height - 8))
  140.             Case Is > 0
  141.                 G.FillRectangle(New SolidBrush(Color.FromArgb(166, 164, 161)), New Rectangle(4, 4, CInt(_Value / _Maximum * Width) - 2, Height - 8))
  142.  
  143.         End Select
  144.  
  145.         DrawBorders(New Pen(New SolidBrush(Color.FromArgb(128, 124, 120))))
  146.         DrawCorners(BackColor)
  147.     End Sub
  148.  
  149.     Protected Overrides Sub ColorHook()
  150.  
  151.     End Sub
  152. End Class
  153.  
  154. Class SteamTextBox
  155.     Inherits ThemeControl153
  156.     Dim WithEvents txtbox As New TextBox
  157.  
  158.     Private _PassMask As Boolean
  159.     Public Property UsePasswordMask() As Boolean
  160.         Get
  161.             Return _PassMask
  162.         End Get
  163.         Set(ByVal v As Boolean)
  164.             _PassMask = v
  165.             Invalidate()
  166.         End Set
  167.     End Property
  168.     Private _maxchars As Integer
  169.     Public Property MaxCharacters() As Integer
  170.         Get
  171.             Return _maxchars
  172.         End Get
  173.         Set(ByVal v As Integer)
  174.             _maxchars = v
  175.         End Set
  176.     End Property
  177.  
  178.     Sub New()
  179.         txtbox.TextAlign = HorizontalAlignment.Center
  180.         txtbox.BorderStyle = BorderStyle.None
  181.         txtbox.Location = New Point(5, 6)
  182.         txtbox.Font = New Font("Verdana", 7.25)
  183.         Controls.Add(txtbox)
  184.         Text = ""
  185.         txtbox.Text = ""
  186.         Me.Size = New Size(135, 35)
  187.         Transparent = True
  188.         BackColor = Color.Transparent
  189.     End Sub
  190.  
  191.     Dim P1 As Pen
  192.  
  193.     Protected Overrides Sub ColorHook()
  194.     End Sub
  195.  
  196.     Protected Overrides Sub PaintHook()
  197.         G.Clear(Color.FromArgb(56, 54, 53))
  198.         Select Case UsePasswordMask
  199.             Case True
  200.                 txtbox.UseSystemPasswordChar = True
  201.             Case False
  202.                 txtbox.UseSystemPasswordChar = False
  203.         End Select
  204.         Size = New Size(Width, 25)
  205.         txtbox.BackColor = Color.FromArgb(56, 54, 53)
  206.         txtbox.ForeColor = Color.FromArgb(195, 193, 191)
  207.         txtbox.Font = Font
  208.         txtbox.Size = New Size(Width - 10, txtbox.Height - 10)
  209.         txtbox.MaxLength = MaxCharacters
  210.         DrawBorders(New Pen(New SolidBrush(Color.FromArgb(112, 109, 105))))
  211.         DrawCorners(BackColor)
  212.     End Sub
  213.     Sub TextChngTxtBox() Handles txtbox.TextChanged
  214.         Text = txtbox.Text
  215.     End Sub
  216.     Sub TextChng() Handles MyBase.TextChanged
  217.         txtbox.Text = Text
  218.     End Sub
  219. End Class
  220.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement