Panel in a Form loses contents
-
Hi all, I have e little problem that I hope someone can help me to solve it. I have a Form in which there is a panel where I draw a graphical diagram using instruction paint, drawline. The graphical is correctly drawn, but if I Minimize the Form and after I re-Maximize the Form, all contents of Form is maintened but the graphical in the Panel is lost. What can/must I do to avoid this problem? I am developing in VB of VS 2008. Thanks
-
Hi all, I have e little problem that I hope someone can help me to solve it. I have a Form in which there is a panel where I draw a graphical diagram using instruction paint, drawline. The graphical is correctly drawn, but if I Minimize the Form and after I re-Maximize the Form, all contents of Form is maintened but the graphical in the Panel is lost. What can/must I do to avoid this problem? I am developing in VB of VS 2008. Thanks
-
Thanks, I will try (I am not expert). Refresh is the same of Repaint?
-
Thanks, I will try (I am not expert). Refresh is the same of Repaint?
No, he means put all of your painting code in a method that is called by the OnPaint event of the Panel. When Windows tells your app to repaint itself, your painting code should do everything it needs to draw everything on the Panel. You'd be surprised how often your painting code is going to be called.
A guide to posting questions on CodeProject
Click this: Asking questions is a skill. Seriously, do it.
Dave Kreskowiak -
No, he means put all of your painting code in a method that is called by the OnPaint event of the Panel. When Windows tells your app to repaint itself, your painting code should do everything it needs to draw everything on the Panel. You'd be surprised how often your painting code is going to be called.
A guide to posting questions on CodeProject
Click this: Asking questions is a skill. Seriously, do it.
Dave KreskowiakThanks all for help. Regards