netrosly

Layle

Jul 8th, 2016
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 2.82 KB | None | 0 0
  1. Public Class layle
  2.     Inherits Control
  3.     Sub New()
  4.         Me.DoubleBuffered = True
  5.         BackColor = Color.FromArgb(163, 191, 57)
  6.     End Sub
  7.     Property TextColor As Color = Color.FromArgb(242, 253, 180)
  8.     Property VoteColor As Color = Color.White
  9.     Property Comment As String = "Hello sexy little Layle. I would like you to give me a thick ham-burgerlyr and fist me like daddy does every night mmmm tasty LAwl."
  10.     Property VoteInt As Integer = 0
  11.     Property _Location As String = "USA"
  12.     Property Duration As String = "11m"
  13.  
  14.     Private Sub layle_MouseDown(sender As Object, e As MouseEventArgs) Handles Me.MouseDown
  15.         If New Rectangle(Me.Width - 35, (Me.Height / 2) - 20, 35, 25).Contains(e.X, e.Y) Then
  16.             VoteInt += 1
  17.             Me.Refresh()
  18.         End If
  19.         If New Rectangle(Me.Width - 35, (Me.Height / 2) + 17, 35, 25).Contains(e.X, e.Y) Then
  20.             VoteInt -= 1
  21.             Me.Refresh()
  22.         End If
  23.     End Sub
  24.  
  25.     Private Sub layle_MouseMove(sender As Object, e As MouseEventArgs) Handles Me.MouseMove
  26.         If New Rectangle(Me.Width - 35, (Me.Height / 2) - 20, 35, 25).Contains(e.X, e.Y) Or New Rectangle(Me.Width - 35, (Me.Height / 2) + 17, 35, 25).Contains(e.X, e.Y) Then
  27.             Cursor = Cursors.Hand
  28.         Else
  29.             Cursor = Cursors.Arrow
  30.         End If
  31.     End Sub
  32.  
  33.     Private Sub layle_Paint(sender As Object, e As PaintEventArgs) Handles Me.Paint
  34.         Dim g As Graphics = e.Graphics
  35.         g.Clear(BackColor)
  36.         g.SmoothingMode = Drawing2D.SmoothingMode.AntiAlias
  37.         g.DrawString(Comment, New Font("Arial", 12, FontStyle.Regular), New SolidBrush(TextColor), New Rectangle(8, 8, Me.Width - 35, Me.Height - 20))
  38.         g.DrawString(VoteInt, New Font("Arial", 16, FontStyle.Regular), New SolidBrush(VoteColor), New Rectangle(Me.Width - 40, (Me.Height / 2) - 3, 40, 20), New StringFormat With {.Alignment = StringAlignment.Center, .LineAlignment = StringAlignment.Center})
  39.         g.DrawLine(New Pen(VoteColor, 5), New Point(Me.Width - 35, (Me.Height / 2) - 7), New Point(Me.Width - 20, (Me.Height / 2) - 20))
  40.         g.DrawLine(New Pen(VoteColor, 5), New Point(Me.Width - 22, (Me.Height / 2) - 20), New Point(Me.Width - 7, (Me.Height / 2) - 7))
  41.  
  42.         g.DrawLine(New Pen(VoteColor, 5), New Point(Me.Width - 35, (Me.Height / 2) + 17), New Point(Me.Width - 20, (Me.Height / 2) + 27))
  43.         g.DrawLine(New Pen(VoteColor, 5), New Point(Me.Width - 22, (Me.Height / 2) + 27), New Point(Me.Width - 9, (Me.Height / 2) + 17))
  44.  
  45.         g.DrawString(Duration, New Font("Arial", 8, FontStyle.Regular), New SolidBrush(TextColor), New Rectangle(Me.Width - 35, Me.Height - 20, 35, 25))
  46.         g.DrawString(_Location, New Font("Arial", 8, FontStyle.Regular), New SolidBrush(TextColor), New Rectangle(25, Me.Height - 20, Me.Width - 45, 25))
  47.     End Sub
  48. End Class
Advertisement
Add Comment
Please, Sign In to add comment