[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.drawing

problems with Paint() event of the control

Adam Edell via DotNetMonster.com

1/19/2005 8:51:00 AM

Hi all, I have one frustrating problem.

I have class which contains Panel control(using for drawing). Drawing in this control is thru Paint() event. In Paint() event I have Graphics object and I'm doing necessery drawing. Some method of class (drawImage or addImage..) in which I call Panel.Invalidate(), control then call panel.Paint() method and drawing is doing fine.

Problem is that in other class I have main Form and when I minimize form, it calls MyDrawingClass.Panel.Paint() so what I get is only panel is drawed on screen and nothing else and I don't want that.

How to only when I need drawing on Panel I do panel and when I do minimize or anything main form take care of that and draw hall window again with panel, normal?

How to resolve this issue?

marko

--
Message posted via http://www.dotnetm...
2 Answers

Bob Powell

1/19/2005 10:35:00 AM

0

Are you saying that when the form is minimized the panel Paint event fires
and you draw the contents anyway?

This sounds odd and even impossible unless you've done something really
strange in the Paint event.

Can you post your code?

--
Bob Powell [MVP]
Visual C#, System.Drawing

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tips...

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/f...

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.





"marko v via DotNetMonster.com" <forum@DotNetMonster.com> wrote in message
news:f3a52092d2604556b61730af14aeec01@DotNetMonster.com...
> Hi all, I have one frustrating problem.
>
> I have class which contains Panel control(using for drawing). Drawing in
> this control is thru Paint() event. In Paint() event I have Graphics
> object and I'm doing necessery drawing. Some method of class (drawImage or
> addImage..) in which I call Panel.Invalidate(), control then call
> panel.Paint() method and drawing is doing fine.
>
> Problem is that in other class I have main Form and when I minimize form,
> it calls MyDrawingClass.Panel.Paint() so what I get is only panel is
> drawed on screen and nothing else and I don't want that.
>
> How to only when I need drawing on Panel I do panel and when I do minimize
> or anything main form take care of that and draw hall window again with
> panel, normal?
>
> How to resolve this issue?
>
> marko
>
> --
> Message posted via http://www.dotnetm...


Adam Edell via DotNetMonster.com

1/19/2005 2:58:00 PM

0

No, I was saying that when I minimize app and then restore it application draw only panel and nothing more.

--
Message posted via http://www.dotnetm...