|
Public Class RectangleForm
Dim pt As Point = Nothing
Dim tollbarFrm As ToolBarForm
Private Sub CancelToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CancelToolStripMenuItem.Click
Me.Close()
End Sub
Private Sub Form3_DoubleClick(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.DoubleClick
Me.tollbarFrm.CaptureRectangleTSB.PerformClick()
End Sub
Private Sub Form2_FormClosed(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosedEventArgs) Handles Me.FormClosed
My.Forms.MenuForm.ObjectTSB.Enabled = True
End Sub
Private Sub Form3_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Me.MouseDown
Me.pt = e.Location
End Sub
Private Sub Form2_MouseEnter(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.MouseEnter
Me.Focus()
End Sub
Private Sub Form3_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Me.MouseMove
If e.Button = Windows.Forms.MouseButtons.Left AndAlso Me.pt <> Nothing Then
Me.Left += e.X - pt.X
Me.Top += e.Y - pt.Y
End If
End Sub
Private Sub Form3_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Me.MouseUp
Me.pt = Nothing
End Sub
Private Sub RectangleForm_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Me.tollbarFrm = New ToolBarForm
Me.tollbarFrm.Left = Me.Left - 200
Me.tollbarFrm.Top = Me.Top
Me.tollbarFrm.Owner = Me
Me.tollbarFrm.Show()
My.Forms.MenuForm.ObjectTSB.Enabled = False
End Sub
Private Sub rectanglePanel_Paint(ByVal sender As System.Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles rectanglePanel.Paint
Dim rect As Rectangle
rect = New Rectangle(6, 6, Me.rectanglePanel.Width - 12, Me.rectanglePanel.Height - 12)
Dim p1 As New Pen(My.Settings.PenColor, My.Settings.PenWidth)
p1.DashStyle = My.Settings.DashStyle
e.Graphics.DrawRectangle(p1, rect)
p1.Dispose()
Me.tollbarFrm.wLabel.Text = CStr(rect.Width - My.Settings.PenWidth)
Me.tollbarFrm.hLabel.Text = CStr(rect.Height - My.Settings.PenWidth)
Me.MinimumSize = New Size(32 + My.Settings.PenWidth, 32 + My.Settings.PenWidth)
If rect.Width - My.Settings.PenWidth > 0 AndAlso rect.Height - My.Settings.PenWidth > 0 Then
Me.tollbarFrm.CaptureRectangleTSB.Enabled = True
Else
Me.tollbarFrm.CaptureRectangleTSB.Enabled = False
End If
End Sub
End Class
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.