Question problem with the control paint

edmontreal

New member
Joined
Jan 15, 2015
Messages
1
Programming Experience
5-10
I guess this is not a graphics related question.

If i move a user control inside a form using the sort of the classic
        override protected   void OnMouseDown( MouseEventArgs e)
        {
          
          m_mouseDownPosition.X = e.X;
          m_mouseDownPosition.Y = e.Y;        
        }
        override protected   void OnMouseMove( MouseEventArgs e)
        {
            if ((e.Button &  MouseButtons.Left) != 0 )
                {                 
                 Left  = Left- ( m_mouseDownPosition.X  - e.X  );
                 Top = Top - (m_mouseDownPosition.Y    - e.Y  );
                }
        }


even when it works it has some weird behavior, if i move the control fast ( not to fast actually ) ,parts of the control are not painted fast enough so if you move it to the right the far right part of the control is not painted while moving. Is there any trick to avoid this?

Thanks



moving.jpgnormal.jpg
 
Last edited by a moderator:
Top Bottom