Advertisement
netrosly

Nanocore Sig Theme

Aug 18th, 2014
461
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 12.96 KB | None | 0 0
  1. Imports System.Drawing.Drawing2D
  2. Imports System.ComponentModel
  3. '//////////////////////////////
  4. '//////NanoCore Sig Theme//////
  5. '//By: Nettro//////////////////
  6. '//Date: 8/18/14///////////////
  7. '//////////////////////////////
  8. Partial Public Class NanoThemeContainer
  9.     Inherits Panel
  10.     Public Sub New()
  11.         Me.SetStyle(ControlStyles.DoubleBuffer Or ControlStyles.AllPaintingInWmPaint Or ControlStyles.UserPaint, True)
  12.         DoubleBuffered = True
  13.     End Sub
  14.     Protected Overrides Sub OnHandleCreated(e As EventArgs)
  15.         FindForm().FormBorderStyle = FormBorderStyle.None
  16.         Me.Dock = DockStyle.Fill
  17.         MyBase.OnHandleCreated(e)
  18.     End Sub
  19.     Protected Overrides Sub OnPaint(e As PaintEventArgs)
  20.         Dim bm As New Bitmap(Me.Width, Me.Height)
  21.         Dim g As Graphics = Graphics.FromImage(bm)
  22.         Me.Padding = New Padding(1, 32, 1, 1)
  23.         '  Dim rect As New Rectangle(0, 0, Me.Width, (Me.Height - 35))
  24.         ' Dim brush As New LinearGradientBrush(rect, Color.FromArgb(250, 250, 250), Color.FromArgb(206, 206, 206), 90.0!)
  25.         'Begin
  26.         '//back
  27.         g.FillRectangle(New SolidBrush(Color.FromArgb(10, 30, 40)), New Rectangle(0, 0, Me.Width, Me.Height))
  28.         '//Border
  29.         g.DrawRectangle(New Pen(Color.FromArgb(4, 14, 19)), New Rectangle(0, 0, Me.Width - 1, Me.Height - 1))
  30.         '//Left Top Linear Gradient Splitter
  31.         Dim rect As New Rectangle(1, 1, Me.Width / 2 - 1, 1)
  32.         Dim brush As New LinearGradientBrush(rect, Color.FromArgb(10, 30, 41), Color.FromArgb(50, 150, 255), 360.0!)
  33.         g.FillRectangle(brush, rect)
  34.         '//Right Top Linear Gradient Splitter
  35.         rect = New Rectangle(Me.Width / 2 - 1, 1, Me.Width / 2, 1)
  36.         brush = New LinearGradientBrush(rect, Color.FromArgb(10, 30, 41), Color.FromArgb(50, 150, 255), 180.0!)
  37.         g.FillRectangle(brush, rect)
  38.         '//Middle Placement
  39.         g.FillRectangle(New SolidBrush(Color.FromArgb(50, 150, 255)), New Rectangle(Me.Width / 2 - 1, 1, 1, 1))
  40.  
  41.         '//Text
  42.         g.DrawString(Me.FindForm.Text, New Font("Arial", 10, FontStyle.Regular), New SolidBrush(Color.White), New Rectangle(24, 13, Me.Width, Me.Height))
  43.         '//Image
  44.         g.DrawIcon(Me.FindForm.Icon, New Rectangle(7, 12, 16, 16))
  45.  
  46.         'Line
  47.         '//Middle Left Linear Gradient Splitter
  48.         rect = New Rectangle(1, 30, Me.Width / 2 - 1, 2)
  49.         brush = New LinearGradientBrush(rect, Color.FromArgb(10, 30, 41), Color.FromArgb(30, 50, 61), 360.0!)
  50.         g.FillRectangle(brush, rect)
  51.         '//Middle Right Linear Gradient Splitter
  52.         rect = New Rectangle(Me.Width / 2 - 1, 30, Me.Width / 2, 2)
  53.         brush = New LinearGradientBrush(rect, Color.FromArgb(10, 30, 41), Color.FromArgb(30, 50, 61), 180.0!)
  54.         g.FillRectangle(brush, rect)
  55.         '//Middle Middle Placement
  56.         g.FillRectangle(New SolidBrush(Color.FromArgb(30, 50, 61)), New Rectangle(Me.Width / 2 - 1, 30, 1, 2))
  57.  
  58.  
  59.  
  60.  
  61.  
  62.         '//Left Bottom Linear Gradient Splitter
  63.         rect = New Rectangle(1, Me.Height - 4, Me.Width / 2 - 1, 1)
  64.         brush = New LinearGradientBrush(rect, Color.FromArgb(10, 30, 41), Color.FromArgb(50, 150, 255), 360.0!)
  65.         g.FillRectangle(brush, rect)
  66.         '//Right Bottom Linear Gradient Splitter
  67.         rect = New Rectangle(Me.Width / 2 - 1, Me.Height - 4, Me.Width / 2, 1)
  68.         brush = New LinearGradientBrush(rect, Color.FromArgb(10, 30, 41), Color.FromArgb(50, 150, 255), 180.0!)
  69.         g.FillRectangle(brush, rect)
  70.         '//Middle Placement
  71.         g.FillRectangle(New SolidBrush(Color.FromArgb(50, 150, 255)), New Rectangle(Me.Width / 2 - 4, Me.Height - 4, 5, 1))
  72.         'end
  73.         e.Graphics.DrawImage(DirectCast(bm.Clone(), Bitmap), 0, 0)
  74.         g.Dispose()
  75.         bm.Dispose()
  76.         MyBase.OnPaint(e)
  77.     End Sub
  78.     Dim x, y As Integer
  79. #Region "ThemeDraggable"
  80.  
  81.     Private savePoint As New Point(0, 0)
  82.     Private isDragging As Boolean = False
  83.  
  84.     Protected Overrides Sub OnMouseDown(e As MouseEventArgs)
  85.         Dim dragRect As New Rectangle(0, 0, Me.Width, 30)
  86.         If dragRect.Contains(New Point(e.X, e.Y)) Then
  87.             isDragging = True
  88.             savePoint = New Point(e.X, e.Y)
  89.         End If
  90.         Dim clickRect As New Rectangle(Me.Width - 24, 10, 13, 12)
  91.         If clickRect.Contains(New Point(e.X, e.Y)) Then
  92.             Environment.[Exit](0)
  93.         End If
  94.         MyBase.OnMouseDown(e)
  95.     End Sub
  96.  
  97.     Protected Overrides Sub OnMouseUp(e As MouseEventArgs)
  98.         isDragging = False
  99.         MyBase.OnMouseUp(e)
  100.     End Sub
  101.  
  102.     Private mouseX As Integer
  103.     Private mouseY As Integer
  104.     Protected Overrides Sub OnMouseMove(e As MouseEventArgs)
  105.         mouseX = e.X
  106.         mouseY = e.Y
  107.         If New Rectangle(Width - 22, 5, 15, 15).Contains(New Point(x, y)) Then
  108.             FindForm.Close()
  109.         End If
  110.         If isDragging Then
  111.             Dim screenPoint As Point = PointToScreen(e.Location)
  112.  
  113.             FindForm().Location = New Point(screenPoint.X - Me.savePoint.X, screenPoint.Y - Me.savePoint.Y)
  114.         End If
  115.         MyBase.OnMouseMove(e)
  116.         Invalidate()
  117.     End Sub
  118.  
  119. #End Region
  120.     Private Sub Theme_Resize(sender As Object, e As EventArgs) Handles Me.Resize
  121.         Me.Refresh()
  122.     End Sub
  123. End Class
  124. Partial Public Class NanoBetaLabel
  125.     Inherits Panel
  126.     Public Sub New()
  127.         Me.SetStyle(ControlStyles.DoubleBuffer Or ControlStyles.AllPaintingInWmPaint Or ControlStyles.UserPaint, True)
  128.         DoubleBuffered = True
  129.     End Sub
  130.     Protected Overrides Sub OnPaint(e As PaintEventArgs)
  131.         Dim bm As New Bitmap(Me.Width, Me.Height)
  132.         Dim g As Graphics = Graphics.FromImage(bm)
  133.         ' Me.Padding = New Padding(13, 39, 13, 24)
  134.         '  Dim rect As New Rectangle(0, 0, Me.Width, (Me.Height - 35))
  135.         ' Dim brush As New LinearGradientBrush(rect, Color.FromArgb(250, 250, 250), Color.FromArgb(206, 206, 206), 90.0!)
  136.         'Begin
  137.         '//border and back
  138.         g.FillRectangle(New SolidBrush(Color.FromArgb(255, 150, 50)), New Rectangle(0, 0, Me.Width, Me.Height))
  139.         g.FillRectangle(New SolidBrush(Color.FromArgb(10, 30, 40)), New Rectangle(2, 2, Me.Width - 4, Me.Height - 4))
  140.         '//
  141.         g.DrawString("BETA", New Font("Arial", 11, FontStyle.Bold), New SolidBrush(Color.FromArgb(255, 150, 50)), New Rectangle(2, 2, Me.Width - 4, Me.Height - 2), New StringFormat With {.Alignment = StringAlignment.Center, .LineAlignment = StringAlignment.Center})
  142.         'end
  143.         e.Graphics.DrawImage(DirectCast(bm.Clone(), Bitmap), 0, 0)
  144.         g.Dispose()
  145.         bm.Dispose()
  146.         MyBase.OnPaint(e)
  147.     End Sub
  148.  
  149.     Private Sub Theme_Resize(sender As Object, e As EventArgs) Handles Me.Resize
  150.         Me.Refresh()
  151.     End Sub
  152. End Class
  153.  
  154. Partial Public Class NanoToggle
  155.     Inherits Panel
  156.     Dim onoff As Boolean = False
  157.     Public Sub New()
  158.         Me.SetStyle(ControlStyles.DoubleBuffer Or ControlStyles.AllPaintingInWmPaint Or ControlStyles.UserPaint, True)
  159.         DoubleBuffered = True
  160.         Me.Size = New Size(78, 27)
  161.     End Sub
  162.  
  163.     <PropertyTab("Onoff")> _
  164.  <DisplayName("Onoff")> _
  165.     Public Property Icons() As Boolean
  166.         Get
  167.             Return onoff
  168.         End Get
  169.         Set(value As Boolean)
  170.             onoff = value
  171.         End Set
  172.     End Property
  173.     Protected Overrides Sub OnPaint(e As PaintEventArgs)
  174.         Dim bm As New Bitmap(Me.Width, Me.Height)
  175.         Dim g As Graphics = Graphics.FromImage(bm)
  176.         ' Me.Padding = New Padding(13, 39, 13, 24)
  177.         '  Dim rect As New Rectangle(0, 0, Me.Width, (Me.Height - 35))
  178.         ' Dim brush As New LinearGradientBrush(rect, Color.FromArgb(250, 250, 250), Color.FromArgb(206, 206, 206), 90.0!)
  179.         'Begin
  180.         If onoff = False Then
  181.             g.FillRectangle(New SolidBrush(Color.FromArgb(132, 132, 132)), New Rectangle(0, 0, Me.Width, Me.Height))
  182.             g.FillRectangle(New SolidBrush(Color.FromArgb(97, 97, 97)), New Rectangle(1, 1, Me.Width / 3, Me.Height - 2))
  183.             g.FillRectangle(New SolidBrush(Color.FromArgb(112, 112, 112)), New Rectangle(2, 2, Me.Width / 3 - 3, Me.Height - 4))
  184.             g.DrawString("x", New Font("Arial", 15, FontStyle.Regular), New SolidBrush(Color.FromArgb(255, 255, 255)), New Rectangle(2, 2, Me.Width / 3 - 3, Me.Height - 6), New StringFormat With {.Alignment = StringAlignment.Center, .LineAlignment = StringAlignment.Center})
  185.  
  186.             g.FillRectangle(New SolidBrush(Color.FromArgb(84, 84, 84)), New Rectangle(Me.Width / 2 + 13 - Me.Width / 3, 1, Me.Width / 3 + 25, Me.Height - 2))
  187.  
  188.             g.FillRectangle(New SolidBrush(Color.FromArgb(240, 240, 240)), New Rectangle(Me.Width / 2 + 13 - Me.Width / 3, 2, Me.Width / 3, Me.Height - 4))
  189.             g.DrawString("|||", New Font("Arial", 8, FontStyle.Regular), New SolidBrush(Color.FromArgb(160, 160, 160)), New Rectangle(Me.Width / 2 + 13 - Me.Width / 3, 2, Me.Width / 3, Me.Height - 4), New StringFormat With {.Alignment = StringAlignment.Center, .LineAlignment = StringAlignment.Center})
  190.  
  191.  
  192.             g.FillRectangle(New SolidBrush(Color.FromArgb(97, 97, 97)), New Rectangle(Me.Width - 25, 2, Me.Width / 3 - 3, Me.Height - 4))
  193.             g.DrawString("Off", New Font("Arial", 8, FontStyle.Regular), New SolidBrush(Color.FromArgb(160, 160, 160)), New Rectangle(Me.Width - 25, 2, Me.Width / 3 - 3, Me.Height - 4), New StringFormat With {.Alignment = StringAlignment.Center, .LineAlignment = StringAlignment.Center})
  194.  
  195.         Else
  196.             g.FillRectangle(New SolidBrush(Color.FromArgb(88, 170, 253)), New Rectangle(0, 0, Me.Width, Me.Height))
  197.             g.FillRectangle(New SolidBrush(Color.FromArgb(53, 135, 218)), New Rectangle(1, 1, Me.Width / 3, Me.Height - 2))
  198.             g.FillRectangle(New SolidBrush(Color.FromArgb(61, 157, 253)), New Rectangle(2, 2, Me.Width / 3 - 3, Me.Height - 4))
  199.             g.DrawString("x", New Font("Arial", 15, FontStyle.Regular), New SolidBrush(Color.FromArgb(255, 255, 255)), New Rectangle(2, 2, Me.Width / 3 - 3, Me.Height - 6), New StringFormat With {.Alignment = StringAlignment.Center, .LineAlignment = StringAlignment.Center})
  200.             g.FillRectangle(New SolidBrush(Color.FromArgb(46, 116, 188)), New Rectangle(Me.Width / 2 + 13 - Me.Width / 3, 1, Me.Width / 3 + 25, Me.Height - 2))
  201.             g.FillRectangle(New SolidBrush(Color.FromArgb(53, 135, 218)), New Rectangle(Me.Width / 2 + 13 - Me.Width / 3, 2, Me.Width / 3, Me.Height - 4))
  202.             g.DrawString("On", New Font("Arial", 8, FontStyle.Regular), New SolidBrush(Color.FromArgb(255, 255, 255)), New Rectangle(Me.Width / 2 + 13 - Me.Width / 3, 2, Me.Width / 3 - 3, Me.Height - 4), New StringFormat With {.Alignment = StringAlignment.Center, .LineAlignment = StringAlignment.Center})
  203.             g.FillRectangle(New SolidBrush(Color.FromArgb(240, 240, 240)), New Rectangle(Me.Width - 25, 2, Me.Width / 3 - 3, Me.Height - 4))
  204.             g.DrawString("|||", New Font("Arial", 8, FontStyle.Regular), New SolidBrush(Color.FromArgb(160, 160, 160)), New Rectangle(Me.Width - 25, 2, Me.Width / 3 - 3, Me.Height - 6), New StringFormat With {.Alignment = StringAlignment.Center, .LineAlignment = StringAlignment.Center})
  205.         End If
  206.         'end
  207.         e.Graphics.DrawImage(DirectCast(bm.Clone(), Bitmap), 0, 0)
  208.         g.Dispose()
  209.         bm.Dispose()
  210.         MyBase.OnPaint(e)
  211.     End Sub
  212.     Dim x, y As Integer
  213. #Region "ThemeDraggable"
  214.  
  215.     Private savePoint As New Point(0, 0)
  216.     Private isDragging As Boolean = False
  217.  
  218.     Protected Overrides Sub OnMouseDown(e As MouseEventArgs)
  219.        
  220.         Dim clickRect As New Rectangle(2, 2, Me.Width / 3 - 3, Me.Height - 6)
  221.         If clickRect.Contains(New Point(e.X, e.Y)) Then
  222.             Me.Dispose()
  223.         End If
  224.         Dim clickRect2 As New Rectangle(Me.Width / 2 + 13 - Me.Width / 3, 2, Me.Width / 3, Me.Height - 4)
  225.         If onoff = False Then
  226.             If clickRect2.Contains(New Point(e.X, e.Y)) Then
  227.                 onoff = True
  228.             End If
  229.         End If
  230.         Dim clickRect3 As New Rectangle(Me.Width - 25, 2, Me.Width / 3 - 3, Me.Height - 4)
  231.         If onoff = True Then
  232.             If clickRect3.Contains(New Point(e.X, e.Y)) Then
  233.                 onoff = False
  234.             End If
  235.         End If
  236.         MyBase.OnMouseDown(e)
  237.     End Sub
  238.  
  239.     Protected Overrides Sub OnMouseUp(e As MouseEventArgs)
  240.         isDragging = False
  241.         MyBase.OnMouseUp(e)
  242.     End Sub
  243.  
  244.     Private mouseX As Integer
  245.     Private mouseY As Integer
  246.     Protected Overrides Sub OnMouseMove(e As MouseEventArgs)
  247.         mouseX = e.X
  248.         mouseY = e.Y
  249.         If New Rectangle(Width - 22, 5, 15, 15).Contains(New Point(x, y)) Then
  250.             FindForm.Close()
  251.         End If
  252.         If isDragging Then
  253.             Dim screenPoint As Point = PointToScreen(e.Location)
  254.  
  255.             FindForm().Location = New Point(screenPoint.X - Me.savePoint.X, screenPoint.Y - Me.savePoint.Y)
  256.         End If
  257.         MyBase.OnMouseMove(e)
  258.         Invalidate()
  259.     End Sub
  260.  
  261. #End Region
  262.     Private Sub Theme_Resize(sender As Object, e As EventArgs) Handles Me.Resize
  263.         Me.Refresh()
  264.     End Sub
  265. End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement