[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

microsoft.public.dotnet.framework.drawing

Paint message received... but no painting!

kevin

12/26/2004 5:59:00 PM

Hello,

I'm writing in C# and have developed a panel control that contains a matrix
of pushbuttons. It seems to work fine until you pull a modal dialog over the
panel. Then drawing goes berserk and you get garbage, so moving the dialog
around causes the display to look very bad.

I've traced messages (paint/invalidate) both for the panel and for the
buttons, and I'm definitely getting paint messages to the buttons, but
apparently it doesn't mean anything: the painting doesn't actually happen??
What's going on here?

Here are my styles for the panel:
DisplayList Style AllPaintingInWmPaint:False
DisplayList Style CacheText:False
DisplayList Style ContainerControl:True
DisplayList Style EnableNotifyMessage:False
DisplayList Style FixedHeight:False
DisplayList Style FixedWidth:False
DisplayList Style Opaque:False
DisplayList Style ResizeRedraw:False
DisplayList Style Selectable:False
DisplayList Style StandardClick:True
DisplayList Style StandardDoubleClick:True
DisplayList Style SupportsTransparentBackColor:True
DisplayList Style UserMouse:False
DisplayList Style UserPaint:True

Any help would be greatly appreciated.
--Kevin
1 Answer

kevin

12/26/2004 7:51:00 PM

0

Never mind. The problem was I was using the PaintEventArgs.ClipRectangle,
which is only the area of the control that actually needs drawing. Since my
paint method only draws the entire control (not a part of it), it got whacked
out. All I had to do was use the ClientRectangle for my button and always
draw the entire thing, and all is well.

--Kevin

"Kevin" wrote:

> Hello,
>
> I'm writing in C# and have developed a panel control that contains a matrix
> of pushbuttons. It seems to work fine until you pull a modal dialog over the
> panel. Then drawing goes berserk and you get garbage, so moving the dialog
> around causes the display to look very bad.
>
> I've traced messages (paint/invalidate) both for the panel and for the
> buttons, and I'm definitely getting paint messages to the buttons, but
> apparently it doesn't mean anything: the painting doesn't actually happen??
> What's going on here?
>
> Here are my styles for the panel:
> DisplayList Style AllPaintingInWmPaint:False
> DisplayList Style CacheText:False
> DisplayList Style ContainerControl:True
> DisplayList Style EnableNotifyMessage:False
> DisplayList Style FixedHeight:False
> DisplayList Style FixedWidth:False
> DisplayList Style Opaque:False
> DisplayList Style ResizeRedraw:False
> DisplayList Style Selectable:False
> DisplayList Style StandardClick:True
> DisplayList Style StandardDoubleClick:True
> DisplayList Style SupportsTransparentBackColor:True
> DisplayList Style UserMouse:False
> DisplayList Style UserPaint:True
>
> Any help would be greatly appreciated.
> --Kevin