Hello,
In my GDI+ application I need to change dynamically some texts. If just write new string over existing one, 2 strings will be superposed.
So, one should to remove old string before to write the new one.
Only solution I found for the moment is to invalidate the specific region of the control, where graphics are drawn (Panel in my case).
It works perfectly - after applying pnl_Graphics.Invalidate(rect1), all graphics inside of rect1 disappear.
But when I draw new text in the same region, it doesn't appear !
What could be a workaround ?
Thanks in advance.
Pavel.

PavelPosted Sep 14, 2012, 7:57 AM
So coding of Paint event cannot be "rigid".
If my understandig is correct if one need to redraw a Control (e.g. Panel), he should call Invalidate method (optionally with limits) - pnl.Invalidate();
Invalidate calls Paint event, that has following interface:
private void pnl_Paint(object sender, PaintEventArgs e)
How to pass some parameters in order to pnl_Paint know what to do ?
Is there some other workaround - without using of Paint handler ?
PavelPosted Sep 14, 2012, 6:56 AM
Thanks for response. There is no any event for redrawing. Until I've met this problem, I don't need it. I drawn all my graphics using dc.DrawRectangle, dc.DrawEllips, dc.DrawString, etc. (where dc - Graphics object, associated with Panel) and all objects are drawn perfectly.
Regards.
Mahesh ChandPosted Sep 14, 2012, 6:47 AM