Discord Server Red Security Twitter Donation to Red Security Red Security Youtube Channel Red Security Tumblr Profile
Login or Register to Hide ads and Accessing all features on the forum

vb.net diamond shaped form by rotating a square

0 Replies, 1654 Views

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: 263)
[img=0x0]https://hackmyass.files.wordpress.com/2011/01/hackers.jpg[/img]

Possibly Related Threads…
Thread Author Replies Views Last Post
  vb.net custom shaped windows form viruss 0 1,721 04-06-2019, 02:12 PM
Last Post: viruss



Users browsing this thread: 1 Guest(s)