Question problem with the control paint


New member
Jan 15, 2015
Programming Experience
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?


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