Advertisement
netrosly

Skype Concept GDI

Aug 11th, 2015
387
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 4.74 KB | None | 0 0
  1. '[By Nettro from HF]
  2. Imports System.Drawing.Drawing2D
  3.  
  4. Public Class Skype_Form
  5.     Inherits ContainerControl
  6.     Sub New()
  7.         Me.DoubleBuffered = True
  8.     End Sub
  9.     Property Border_Color As Color = Color.FromArgb(24, 51, 57)
  10.     Property inBorder_Color As Color = Color.FromArgb(96, 174, 208)
  11.     Property iinBorder_Color As Color = Color.FromArgb(96, 174, 208)
  12.     Property Sky1_Color As Color = Color.FromArgb(68, 195, 251)
  13.     Property Sky2_Color As Color = Color.FromArgb(28, 178, 248)
  14.     Property Cloud_Color As Color = Color.FromArgb(52, 186, 249) '32, 166, 229
  15.     Private Sub Skype_Form_Paint(sender As Object, e As PaintEventArgs) Handles Me.Paint
  16.         e.Graphics.SmoothingMode = SmoothingMode.HighQuality
  17.         'back
  18.         Dim rect = New Rectangle(1, 1, Me.Width - 3, Me.Height - 3)
  19.         Dim brushs = New LinearGradientBrush(rect, Sky1_Color, Sky2_Color, 90.0!)
  20.         e.Graphics.FillRectangle(brushs, rect)
  21.         'Clouds
  22.         rect = New Rectangle(-140, Me.Height / 2 + 100, Me.Width / 3 + 250, Me.Height)
  23.         brushs = New LinearGradientBrush(rect, Sky1_Color, Sky2_Color, 90.0!)
  24.         e.Graphics.FillEllipse(brushs, New Rectangle(-140, Me.Height / 2 + 100, Me.Width / 3 + 250, Me.Height))
  25.         e.Graphics.FillEllipse(brushs, New Rectangle(-20 + ((Me.Width / 3) * 1), Me.Height / 2 + 130, Me.Width / 3 + 120, Me.Height))
  26.         rect = New Rectangle(-20 + (Me.Width / 3) * 2, Me.Height / 2 + 40, Me.Width / 3 + 250, Me.Height)
  27.         brushs = New LinearGradientBrush(rect, Sky1_Color, Sky2_Color, 90.0!)
  28.         e.Graphics.FillEllipse(brushs, New Rectangle(-20 + (Me.Width / 3) * 2, Me.Height / 2 + 40, Me.Width / 3 + 250, Me.Height))
  29.         'top
  30.         rect = New Rectangle(3, 3, Me.Width - 5, 9)
  31.         brushs = New LinearGradientBrush(rect, Color.FromArgb(60, 255, 255, 255), Color.Transparent, 90.0!)
  32.         e.Graphics.FillRectangle(brushs, rect)
  33.         'bottom
  34.         rect = New Rectangle(3, Me.Height - 10, Me.Width - 5, 8)
  35.         brushs = New LinearGradientBrush(rect, Color.Transparent, Color.FromArgb(60, 255, 255, 255), 90.0!)
  36.         e.Graphics.FillRectangle(brushs, rect)
  37.  
  38.         'border
  39.         e.Graphics.DrawRectangle(New Pen(Border_Color), New Rectangle(-1, -1, Me.Width + 1, Me.Height + 1))
  40.         e.Graphics.DrawRectangle(New Pen(inBorder_Color), New Rectangle(0, 0, Me.Width - 1, Me.Height - 1))
  41.         e.Graphics.DrawRectangle(New Pen(iinBorder_Color), New Rectangle(1, 1, Me.Width - 3, Me.Height - 3))
  42.         e.Graphics.DrawRectangle(New Pen(Color.FromArgb(60, 255, 255, 255)), New Rectangle(2, 2, Me.Width - 5, Me.Height - 5))
  43.         e.Graphics.DrawString(FindForm.Text, New Font("Arial", 12, FontStyle.Regular), Brushes.White, New Rectangle(0, 5, Me.Width, 30), New StringFormat With {.Alignment = StringAlignment.Center, .LineAlignment = StringAlignment.Center})
  44.     End Sub
  45.  
  46.     Private Sub Skype_Form_Resize(sender As Object, e As EventArgs) Handles Me.Resize
  47.         Me.Refresh()
  48.     End Sub
  49. #Region "ThemeDraggable"
  50.     Dim x, y As Integer
  51.     Private savePoint As New Point(0, 0)
  52.     Private isDragging As Boolean = False
  53.  
  54.     Protected Overrides Sub OnMouseDown(e As MouseEventArgs)
  55.         Dim dragRect As New Rectangle(0, 0, Me.Width - 70, 30)
  56.         If dragRect.Contains(New Point(e.X, e.Y)) Then
  57.             isDragging = True
  58.             savePoint = New Point(e.X, e.Y)
  59.         End If
  60.         '
  61.         If e.Button = System.Windows.Forms.MouseButtons.Left Then
  62.             If New Rectangle(Me.Width - 20, 13, 16, 16).Contains(e.X, e.Y) Then
  63.                 Environment.Exit(0)
  64.             End If
  65.             If New Rectangle(Me.Width - 40, 13, 16, 16).Contains(e.X, e.Y) Then
  66.                 If FindForm.WindowState = FormWindowState.Normal Then
  67.                     FindForm.WindowState = FormWindowState.Maximized
  68.                 Else
  69.                     FindForm.WindowState = FormWindowState.Normal
  70.                 End If
  71.             End If
  72.             If New Rectangle(Me.Width - 60, 13, 16, 16).Contains(e.X, e.Y) Then
  73.                 FindForm.WindowState = FormWindowState.Minimized
  74.             End If
  75.         End If
  76.         MyBase.OnMouseDown(e)
  77.     End Sub
  78.  
  79.     Protected Overrides Sub OnMouseUp(e As MouseEventArgs)
  80.         isDragging = False
  81.         MyBase.OnMouseUp(e)
  82.     End Sub
  83.  
  84.     Private mouseX As Integer
  85.     Private mouseY As Integer
  86.     Protected Overrides Sub OnMouseMove(e As MouseEventArgs)
  87.  
  88.         mouseX = e.X
  89.         mouseY = e.Y
  90.  
  91.         If isDragging Then
  92.             Dim screenPoint As Point = PointToScreen(e.Location)
  93.  
  94.             FindForm().Location = New Point(screenPoint.X - Me.savePoint.X, screenPoint.Y - Me.savePoint.Y)
  95.         End If
  96.         MyBase.OnMouseMove(e)
  97.         Invalidate()
  98.     End Sub
  99.  
  100. #End Region
  101. End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement