Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Public Structure Area
- Public minX As Integer
- Public minY As Integer
- Public maxX As Integer
- Public maxY As Integer
- Public xForward As Boolean
- Public yForward As Boolean
- Public Lock As Boolean
- End Structure
- Dim Selection As Area
- Private Sub PictureBox6_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles PictureBox6.MouseMove
- If Selection.Lock = True Then
- With Selection
- If e.Location.X < 0 Then
- .minX = 0
- ElseIf e.Location.Y < 0 Then
- .minY = 0
- ElseIf PictureBox6.Width < e.Location.X Then
- .maxX = PictureBox6.Width - 1
- If PictureBox6.Height > e.Location.Y Then
- If e.Location.Y > .minY Then
- If .yForward = True Then
- .maxY = e.Location.Y
- Else
- If e.Location.Y < .maxY Then
- .minY = e.Location.Y
- Else
- .minY = .maxY
- .maxY = e.Location.Y
- .yForward = True
- End If
- End If
- Else
- If .yForward = True Then
- .maxY = .minY
- .minY = e.Location.Y
- .yForward = False
- Else
- If .minY <= .maxY Then
- .minY = e.Location.Y
- Else
- .maxY = e.Location.Y
- End If
- End If
- End If
- End If
- ElseIf PictureBox6.Height < e.Location.Y Then
- .maxY = PictureBox6.Height - 1
- If PictureBox6.Width > e.Location.X Then
- If e.Location.X > .minX Then
- If .xForward = True Then
- .maxX = e.Location.X
- Else
- If e.Location.X < .maxX Then
- .minX = e.Location.X
- Else
- .minX = .maxX
- .maxX = e.Location.X
- .xForward = True
- End If
- End If
- Else
- If .xForward = True Then
- .maxX = .minX
- .minX = e.Location.X
- .xForward = False
- Else
- If .minX <= .maxX Then
- .minX = e.Location.X
- Else
- .maxX = e.Location.X
- End If
- End If
- End If
- End If
- Else
- If e.Location.X > .minX Then
- If .xForward = True Then
- .maxX = e.Location.X
- Else
- If e.Location.X < .maxX Then
- .minX = e.Location.X
- Else
- .minX = .maxX
- .maxX = e.Location.X
- .xForward = True
- End If
- End If
- Else
- If .xForward = True Then
- .maxX = .minX
- .minX = e.Location.X
- .xForward = False
- Else
- If .minX <= .maxX Then
- .minX = e.Location.X
- Else
- .maxX = e.Location.X
- End If
- End If
- End If
- If e.Location.Y > .minY Then
- If .yForward = True Then
- .maxY = e.Location.Y
- Else
- If e.Location.Y < .maxY Then
- .minY = e.Location.Y
- Else
- .minY = .maxY
- .maxY = e.Location.Y
- .yForward = True
- End If
- End If
- Else
- If .yForward = True Then
- .maxY = .minY
- .minY = e.Location.Y
- .yForward = False
- Else
- If .minY <= .maxY Then
- .minY = e.Location.Y
- Else
- .maxY = e.Location.Y
- End If
- End If
- End If
- End If
- TextBox22.Text = Round(6000 / TrackBar14.Value * .minX - 3000, 6)
- TextBox23.Text = Round(6000 / TrackBar14.Value * .minY - 3000, 6)
- If .maxX = PictureBox6.Width - 1 Then
- TextBox24.Text = 3000
- Else
- TextBox24.Text = Round(6000 / TrackBar14.Value * .maxX - 3000, 6)
- End If
- If .maxY = PictureBox6.Height - 1 Then
- TextBox25.Text = 3000
- Else
- TextBox25.Text = Round(6000 / TrackBar14.Value * .maxY - 3000, 6)
- End If
- TextBox22.Text = TextBox22.Text.Replace(",", ".")
- TextBox23.Text = TextBox23.Text.Replace(",", ".")
- TextBox24.Text = TextBox24.Text.Replace(",", ".")
- TextBox25.Text = TextBox25.Text.Replace(",", ".")
- PictureBox6.Refresh()
- PictureBox6.CreateGraphics.DrawRectangle(New Pen(Settings.C_Area.Hex), New Rectangle(.minX, .minY, .maxX - .minX, .maxY - .minY))
- PictureBox6.CreateGraphics.Dispose()
- End With
- End If
- End Sub
Add Comment
Please, Sign In to add comment