Discord Server Twitter Donation Youtube
Windscribe
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
vb.net diamond shaped form by rotating a square
#1
vb.net diamond shaped from

<code>
Public Class Form1
    Private IsFormBeingDragged As Boolean = False
    Private MouseDownX As Integer
    Private MouseDownY As Integer
    Private Sub Form1_MouseDown(ByVal sender As Object, ByVal e As MouseEventArgs) Handles MyBase.MouseDown

        If e.Button = MouseButtons.Left Then
            IsFormBeingDragged = True
            MouseDownX = e.X
            MouseDownY = e.Y
        End If
    End Sub

    Private Sub Form1_MouseUp(ByVal sender As Object, ByVal e As MouseEventArgs) Handles MyBase.MouseUp

        If e.Button = MouseButtons.Left Then
            IsFormBeingDragged = False
        End If
    End Sub

    Private Sub Form1_MouseMove(ByVal sender As Object, ByVal e As MouseEventArgs) Handles MyBase.MouseMove

        If IsFormBeingDragged Then
            Dim temp As Point = New Point()

            temp.X = Me.Location.X + (e.X - MouseDownX)
            temp.Y = Me.Location.Y + (e.Y - MouseDownY)
            Me.Location = temp
            temp = Nothing
        End If
    End Sub


    Private Sub Form1_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles Me.Paint
        Dim pen1 As New Pen(Color.Red, 10)
        e.Graphics.RotateTransform(45.0F)
        e.Graphics.FillRectangle(Brushes.Black, New Rectangle(350, -80, 420, 420))
        e.Graphics.RotateTransform(-90.0F)
        e.Graphics.DrawRectangle(pen1, -290, 400, 320, 320)
    End Sub



    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load

    End Sub
End Class

</code>


no image this time

form1 property set:
backcolor : red
formborderstyle:none
transparency red

 
.zip   diamondshape.zip (Size: 74 KB / Downloads: 19)
[img=0x0]https://hackmyass.files.wordpress.com/2011/01/hackers.jpg[/img]
Reply




Users browsing this thread: 1 Guest(s)