Coordinated should be OK. A previous version of the
program runs correctly, maximized or not, the current non-
MDI forms work correctly when not maximized or in upper
left, but MDI kids dont work, with the same code copied
and pasted in. I compared the mouse code between the old
working form and the new non-working form, and that code
is the same, that's why I suspect a refreshing-form-
setting scenario. Are there settings that behave like the
old AutoRedraw that might be causing a form refresh or
someting? Appreciate the help (a lot!)
The test code that works in non-mdi, but not in mdi kids.:
' True while we are drawing the new line.
Private m_Drawing As Boolean
' Buffer for erasing rubberband lines.
Private m_BufferBitmap As Bitmap
Private m_BufferGraphics As Graphics
' The mouse position.
Private m_Pos1 As Point
Private m_Pos2 As Point
Private Sub picTest_MouseDown(ByVal sender As Object,
ByVal e As System.Windows.Forms.MouseEventArgs) Handles
picTest.MouseDown
' Do nothing if this isn't the left mouse button.
If e.Button <> MouseButtons.Left Then Exit Sub
m_Drawing = True
' Save the current mouse position.
m_Pos1 = Control.MousePosition
m_Pos2 = m_Pos1
End Sub
Private Sub picTest_MouseMove(ByVal sender As Object,
ByVal e As System.Windows.Forms.MouseEventArgs) Handles
picTest.MouseMove
' Do nothing if we're not drawing.
If Not m_Drawing Then Exit Sub
' Erase the previous line.
ControlPaint.DrawReversibleLine( _
m_Pos1, m_Pos2, Me.BackColor)
' Save the new point.
m_Pos2 = Control.MousePosition
' Draw the new line.
ControlPaint.DrawReversibleLine( _
m_Pos1, m_Pos2, Me.BackColor)
End Sub
Private Sub picTest_MouseUp(ByVal sender As Object,
ByVal e As System.Windows.Forms.MouseEventArgs) Handles
picTest.MouseUp
' Do nothing if we're not drawing.
If Not m_Drawing Then Exit Sub
m_Drawing = False
End Sub