C#: Windows Forms: What could cause Invalidate() to not redraw?

前端 未结 3 1744
无人共我
无人共我 2020-12-31 08:56

I\'m using Windows Forms. For a long time, pictureBox.Invalidate(); worked to make the screen be redrawn. However, it now doesn\'t work and I\'m not sure why.

3条回答
  •  太阳男子
    2020-12-31 09:18

    Invalidate() only "invalidates" the control or form (marks it for repainting), but does not force a redraw. It will be redrawn as soon as the application gets around to repainting again when there are no more messages to process in the message queue. If you want to force a repaint, you can use Refresh().

提交回复
热议问题