In Visual C#, I built a component(not a user control) to draw a data line chart to display datas coming from socket. I put the drawing codes in the Paint event, so I called Invalidate after a new data pack comes. But when the form is minimized, it seems the drawing has been stoped. After the form is restored,there are some data in the buffer still need to be refresh , which cause a delay of the display (depends on how long the form has been keep minimized).
What is the machnism should I use to refresh the line chart even if it is not displayed?
call
Invalidate()
to tell the system that, next time it becomes visible it should be redrawn (you're already doing this)then call
Update()
which forces the redraw to take place right now (you might want to make this call only if you are minimized)Alternatively simply call the
Refresh()
method.