When minimized, 'Graphics' hides

  • Thread starter Thread starter voytello
  • Start date Start date
V

voytello

Hello Everyone,

If this problem was already mentioned on this group, please forgive me
but I couldn't find it.

I've made a simple app to train using the class Graphics. The Form
property FormBorderStyle I've set as "None", then I've used class
Graphics to create some Elipses and Rectangles.
Also I've created Button to minimize window - with Event to this button
as:
{
this.WindowState = System.Windows.Forms.FormWindowState.Minimized;
}

When I run this and click on minimize button, it minimizes to task bar,
everything is ok, but when I click to show it again, all my Graphics
objects are hidden... I don't know what to do with it...

Thanks in advance,
V
 
voytello said:
Hello Everyone,

If this problem was already mentioned on this group, please forgive me
but I couldn't find it.

I've made a simple app to train using the class Graphics. The Form
property FormBorderStyle I've set as "None", then I've used class
Graphics to create some Elipses and Rectangles.
Also I've created Button to minimize window - with Event to this button
as:
{
this.WindowState = System.Windows.Forms.FormWindowState.Minimized;
}

When I run this and click on minimize button, it minimizes to task bar,
everything is ok, but when I click to show it again, all my Graphics
objects are hidden... I don't know what to do with it...

When are you doing your drawing? If you just do it once, then the next
time the form is repainted (form restored, another window moved over
your form then moved away), your changes will be lost. The proper place
to do drawing is in the Paint event.

You might find <http://www.bobpowell.net/faqmain.htm> useful - note what
the #1 question is...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top