a7m3dalbalawi

cTheme v.1.0 By KingDom

Jan 9th, 2016
468
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 9.76 KB | None | 0 0
  1.  
  2. '----------------------------------------------------|
  3. '                                                    |
  4. '       Design & Coder : KingDom - الممَلكة .        |
  5. '       Site : Dev-Point.Com .                       |
  6. '       Contact With me on Skype : KingDomSc .       |
  7. '                                                    |
  8. '----------------------------------------------------|
  9.  
  10.  
  11. Class cForm
  12.     Inherits ThemeContainer154
  13.     Sub New()
  14.         BackColor = Color.White
  15.         SetColor("FirstColor", Color.FromArgb(227, 227, 227))
  16.         SetColor("TextColor", Color.FromArgb(75, 75, 75))
  17.         SetColor("BorderColor", Color.FromArgb(75, 75, 75))
  18.         SetColor("TopColor", Color.FromArgb(237, 237, 237))
  19.  
  20.     End Sub
  21.     Dim FirstColor As Color
  22.     Dim BorderColor As Color
  23.     Dim TextColor As Color
  24.     Dim TopColor As Color
  25.     Protected Overrides Sub ColorHook()
  26.         FirstColor = GetColor("FirstColor")
  27.         BorderColor = GetColor("BorderColor")
  28.         TextColor = GetColor("TextColor")
  29.         TopColor = GetColor("TopColor")
  30.     End Sub
  31.     Protected Overrides Sub PaintHook()
  32.         G.Clear(BackColor)
  33.         G.FillRectangle(New SolidBrush(BackColor), New Rectangle(0, 0, Width, Height))
  34.         Dim TopG As New LinearGradientBrush(New Rectangle(0, 0, Width - 1, 50), TopColor, Color.White, 90)
  35.         G.FillRectangle(TopG, New Rectangle(0, 0, Width - 1, 30))
  36.         G.DrawString(FindForm.Text, New Font("Tahoma", 12, FontStyle.Regular, GraphicsUnit.Pixel), New SolidBrush(Color.White), New Point(43, 19))
  37.         G.DrawString(FindForm.Text, New Font("Tahoma", 12, FontStyle.Regular, GraphicsUnit.Pixel), New SolidBrush(TextColor), New Point(42, 18))
  38.         G.DrawIcon(FindForm.Icon, New Rectangle(10, 10, 30, 30))
  39.         G.DrawRectangle(New Pen(BorderColor), New Rectangle(0, 0, Width - 1, Height - 1))
  40.        
  41.     End Sub
  42. End Class
  43. Class cLabel
  44.     Inherits ThemeControl154
  45.     Dim TextColor As Color
  46.     Sub New()
  47.         SetColor("Text", Color.Black)
  48.  
  49.     End Sub
  50.     Protected Overrides Sub ColorHook()
  51.         TextColor = GetColor("Text")
  52.     End Sub
  53.  
  54.     Protected Overrides Sub PaintHook()
  55.         G.Clear(Color.White)
  56.         Dim FormatString As New StringFormat()
  57.         FormatString.LineAlignment = StringAlignment.Center
  58.         FormatString.Alignment = StringAlignment.Center
  59.         G.DrawString(Text, New Font("Tahoma", 12, FontStyle.Regular, GraphicsUnit.Pixel), New SolidBrush(Color.FromArgb(130, 130, 130)), New Rectangle(0, 0, Width - 1, Height - 1), FormatString)
  60.         G.FillRectangle(New SolidBrush(Color.FromArgb(73, 138, 242)), New Rectangle(0, 0, 1, Height - 1))
  61.     End Sub
  62. End Class
  63. Class cButton
  64.     Inherits ThemeControl154
  65.  
  66.     Sub New()
  67.         SetColor("ColorTop", Color.FromArgb(77, 143, 253))
  68.         SetColor("ColorBottom", Color.FromArgb(71, 135, 237))
  69.         SetColor("TextColor", Color.Black)
  70.         FormatString.Alignment = StringAlignment.Center
  71.         FormatString.LineAlignment = StringAlignment.Center
  72.     End Sub
  73.     Dim ColorTop As Color
  74.     Dim ColorBottom As Color
  75.     Dim TextColor As Color
  76.     Protected Overrides Sub ColorHook()
  77.         ColorTop = GetColor("ColorTop")
  78.         ColorBottom = GetColor("ColorBottom")
  79.         TextColor = GetColor("TextColor")
  80.     End Sub
  81.     Dim FormatString As New StringFormat()
  82.     Protected Overrides Sub PaintHook()
  83.         G.Clear(BackColor)
  84.         Cursor = Cursors.Hand
  85.         Select Case State
  86.             Case MouseState.None
  87.                 Dim LG As New LinearGradientBrush(New Rectangle(0, 0, Width - 1, Height - 1), ColorTop, ColorBottom, 90)
  88.                 G.FillRectangle(LG, New Rectangle(0, 0, Width - 1, Height - 1))
  89.                 G.DrawRectangle(New Pen(Color.FromArgb(48, 121, 237)), New Rectangle(0, 0, Width - 1, Height - 1))
  90.                 G.DrawString(Text, New Font("arial", 13, FontStyle.Bold, GraphicsUnit.World), New SolidBrush(Color.White), New Rectangle(0, 2, Width - 1, Height - 1), FormatString)
  91.             Case MouseState.Over
  92.                 Dim LG As New LinearGradientBrush(New Rectangle(0, 0, Width - 1, Height - 1), ColorTop, Color.FromArgb(53, 122, 232), 90)
  93.                 G.FillRectangle(LG, New Rectangle(0, 0, Width - 1, Height - 1))
  94.                 G.DrawRectangle(New Pen(Color.FromArgb(47, 91, 183)), New Rectangle(0, 0, Width - 1, Height - 1))
  95.                 G.DrawString(Text, New Font("arial", 13, FontStyle.Bold, GraphicsUnit.World), New SolidBrush(Color.White), New Rectangle(0, 2, Width - 1, Height - 1), FormatString)
  96.  
  97.             Case MouseState.Down
  98.                 Dim LG As New LinearGradientBrush(New Rectangle(0, 0, Width - 1, Height - 1), ColorTop, Color.FromArgb(53, 122, 232), 90)
  99.                 G.FillRectangle(LG, New Rectangle(0, 0, Width - 1, Height - 1))
  100.                 G.DrawRectangle(New Pen(Color.FromArgb(47, 91, 183)), New Rectangle(0, 0, Width - 1, Height - 1))
  101.                 G.FillRectangle(New SolidBrush(Color.FromArgb(61, 115, 203)), New Rectangle(0, 0, Width, 3))
  102.                 G.FillRectangle(New SolidBrush(Color.FromArgb(61, 115, 203)), New Rectangle(0, 0, 3, Height))
  103.                 G.FillRectangle(New SolidBrush(Color.FromArgb(61, 115, 203)), New Rectangle(Width - 3, 0, 3, Height))
  104.                 G.DrawString(Text, New Font("arial", 13, FontStyle.Bold, GraphicsUnit.World), New SolidBrush(Color.White), New Rectangle(0, 2, Width - 1, Height - 1), FormatString)
  105.  
  106.         End Select
  107.     End Sub
  108.  
  109. End Class
  110. Class cMiniButton
  111.     Inherits ThemeControl154
  112.  
  113.     Sub New()
  114.         SetColor("TextColor", Color.FromArgb(128, 128, 128))
  115.         SetColor("BackColor1", Color.FromArgb(227, 227, 227))
  116.         SetColor("BorderColor", Color.FromArgb(179, 179, 179))
  117.     End Sub
  118.     Dim Textcolor As Color
  119.     Dim Backcolor1 As Color
  120.     Dim Bordercolor As Color
  121.     Dim FormatString As New StringFormat()
  122.     Protected Overrides Sub ColorHook()
  123.         Textcolor = GetColor("TextColor")
  124.         Backcolor1 = GetColor("BackColor1")
  125.         Bordercolor = GetColor("BorderColor")
  126.         FormatString.LineAlignment = StringAlignment.Center
  127.         FormatString.Alignment = StringAlignment.Center
  128.     End Sub
  129.  
  130.     Protected Overrides Sub PaintHook()
  131.         Cursor = Cursors.Hand
  132.         G.Clear(Backcolor1)
  133.         Width = 23
  134.         Height = 15
  135.  
  136.         Select Case State
  137.             Case MouseState.None
  138.                 G.FillRectangle(New SolidBrush(Backcolor1), New Rectangle(0, 0, Width - 1, Height - 1))
  139.                 G.DrawString("-", New Font("Tahoma", 15, FontStyle.Bold, GraphicsUnit.World), New SolidBrush(Textcolor), New Rectangle(0, 1, Width - 1, Height - 1), FormatString)
  140.                 G.DrawRectangle(New Pen(Bordercolor), New Rectangle(0, 0, Width - 1, Height - 1))
  141.  
  142.             Case MouseState.Over
  143.                 G.FillRectangle(New SolidBrush(Textcolor), New Rectangle(0, 0, Width - 1, Height - 1))
  144.                 G.DrawString("-", New Font("Tahoma", 15, FontStyle.Bold, GraphicsUnit.World), New SolidBrush(Backcolor1), New Rectangle(0, 1, Width - 1, Height - 1), FormatString)
  145.                 G.DrawRectangle(New Pen(Bordercolor), New Rectangle(0, 0, Width - 1, Height - 1))
  146.  
  147.             Case MouseState.Down
  148.                 G.FillRectangle(New SolidBrush(Backcolor1), New Rectangle(0, 0, Width - 1, Height - 1))
  149.                 G.DrawString("-", New Font("Tahoma", 15, FontStyle.Bold, GraphicsUnit.World), New SolidBrush(Textcolor), New Rectangle(0, 1, Width - 1, Height - 1), FormatString)
  150.                 G.DrawRectangle(New Pen(Bordercolor), New Rectangle(0, 0, Width - 1, Height - 1))
  151.                 FindForm.WindowState = FormWindowState.Minimized
  152.         End Select
  153.     End Sub
  154. End Class
  155. Class cMaxButton
  156.     Inherits ThemeControl154
  157.  
  158.     Sub New()
  159.         SetColor("TextColor", Color.FromArgb(128, 128, 128))
  160.         SetColor("BackColor1", Color.FromArgb(227, 227, 227))
  161.         SetColor("BorderColor", Color.FromArgb(179, 179, 179))
  162.     End Sub
  163.     Dim Textcolor As Color
  164.     Dim Backcolor1 As Color
  165.     Dim Bordercolor As Color
  166.     Dim FormatString As New StringFormat()
  167.     Protected Overrides Sub ColorHook()
  168.         Textcolor = GetColor("TextColor")
  169.         Backcolor1 = GetColor("BackColor1")
  170.         Bordercolor = GetColor("BorderColor")
  171.         FormatString.LineAlignment = StringAlignment.Center
  172.         FormatString.Alignment = StringAlignment.Center
  173.     End Sub
  174.  
  175.     Protected Overrides Sub PaintHook()
  176.         Cursor = Cursors.Hand
  177.         G.Clear(Backcolor1)
  178.         Width = 23
  179.         Height = 15
  180.  
  181.         Select Case State
  182.             Case MouseState.None
  183.                 G.FillRectangle(New SolidBrush(Backcolor1), New Rectangle(0, 0, Width - 1, Height - 1))
  184.                 G.DrawString("x", New Font("Tahoma", 11, FontStyle.Bold, GraphicsUnit.World), New SolidBrush(Textcolor), New Rectangle(0, 0, Width - 1, Height - 1), FormatString)
  185.                 G.DrawRectangle(New Pen(Bordercolor), New Rectangle(0, 0, Width - 1, Height - 1))
  186.  
  187.             Case MouseState.Over
  188.                 G.FillRectangle(New SolidBrush(Textcolor), New Rectangle(0, 0, Width - 1, Height - 1))
  189.                 G.DrawString("x", New Font("Tahoma", 11, FontStyle.Bold, GraphicsUnit.World), New SolidBrush(Backcolor1), New Rectangle(0, 0, Width - 1, Height - 1), FormatString)
  190.                 G.DrawRectangle(New Pen(Bordercolor), New Rectangle(0, 0, Width - 1, Height - 1))
  191.  
  192.             Case MouseState.Down
  193.                 G.FillRectangle(New SolidBrush(Backcolor1), New Rectangle(0, 0, Width - 1, Height - 1))
  194.                 G.DrawString("x", New Font("Tahoma", 11, FontStyle.Bold, GraphicsUnit.World), New SolidBrush(Textcolor), New Rectangle(0, 0, Width - 1, Height - 1), FormatString)
  195.                 G.DrawRectangle(New Pen(Bordercolor), New Rectangle(0, 0, Width - 1, Height - 1))
  196.                 End
  197.         End Select
  198.     End Sub
  199. End Class
Advertisement
Add Comment
Please, Sign In to add comment