Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

.NET 

Region Capture Control {Form}

i guess many have use for this

[Image: 8OPrhdd.png]

http://pastebin.com/HV30Cavq

🤝
Fuck ur code.

Code
Private MyRectangle As Rectangle
    Private Drawing As Boolean = False
    Private StartX, StartY, CursorX, CursorY As Single
    Private Sub Region_Drag_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles Me.Paint
      If Drawing = True Then
      Dim Oral_Pen As New Pen(Brushes.Red, 2) 'Color and Size
      Oral_Pen.DashStyle = Drawing2D.DashStyle.Solid 'Pattern
      MyRectangle = New Rectangle(Min(StartX, CursorX), _
      Min(StartY, CursorY), _
      Abs(StartX - CursorX), _
      Abs(StartY - CursorY))
      e.Graphics.FillRectangle(New SolidBrush(Color.Transparent), MyRectangle)
      e.Graphics.DrawRectangle(Oral_Pen, MyRectangle)
      End If
    End Sub
    Private Sub Region_Drag_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyDown
      If e.KeyCode = Keys.Escape Then
      Application.Exit()  'escape from expectations
      End If
    End Sub
    Private Sub Region_Drag_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Me.MouseDown
      Me.BackColor = Color.Fuchsia 'or this
      Me.Opacity = 100% 'Dont need this
      Drawing = True
      StartX = e.X
      StartY = e.Y
      CursorX = e.X
      CursorY = e.Y
    End Sub
    Private Sub Region_Drag_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Me.MouseMove
      If Not Drawing Then Exit Sub
      Dim G As Graphics = Me.CreateGraphics
      CursorX = e.X
      CursorY = e.Y
      Me.Invalidate()
    End Sub
    Private Sub Region_Drag_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Me.MouseUp
      Drawing = False
      Dim G As Graphics = Me.CreateGraphics
      G.DrawRectangle(Pens.Black, MyRectangle.X, MyRectangle.Y, MyRectangle.Width, MyRectangle.Height)

      Me.Invalidate()
      Me.Dispose()
    End Sub
    Private Sub Region_Drag_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
      Me.Focus()
      Me.FormBorderStyle = Windows.Forms.FormBorderStyle.None
      Me.TopMost = True
      Me.Location = New Point(0, 0)
      Me.Size = Screen.PrimaryScreen.Bounds.Size
      Me.DoubleBuffered = True
    End Sub

Mine is easier to understand and more copy pastable for noobs.
the only1 that reply was this dumb 😊
(Nov 24, 2014 02:17 PM)AEDEAD Wrote:  Mine is easier to understand and more copy pastable for noobs.

Let's not brag about how skiddable our code is.
Good that you changed the avatar, but bad that you are using VB6 funcs.
(Nov 26, 2014 03:04 PM)SIM-1456245 Wrote:  Good that you changed the avatar, but bad that you are using VB6 funcs.

i use Environ cuz its short and im lazy


Possibly Related Threads...
Thread / Author Replies Views Last Post
[Java] by quartzdFeb 23, 2016 05:07 AM 4 202 Feb 23, 2016 05:07 AM
Last Post: Sogomn
[C#] by quartzdFeb 20, 2016 03:38 PM 6 201 Feb 20, 2016 03:38 PM
Last Post: quartzd
[.NET] by DiamondoNov 27, 2015 11:52 AM 2 177 Nov 27, 2015 11:52 AM
Last Post: Diamondo