B
Blair Bonnett
Hi all,
Run into a problem I can't find a solution for. I'm writing a C# app
which has a custom background for the form (a gradient). I've
successfully overridden the forms OnPaintBackground(PaintEventArgs
pevent) method to paint the background.
However, it seems that some of the controls on the form (such as the
labels) also call this method and hence get painted with the gradient.
Is there some way I can tell what control (or type of control) is being
painted, so only the form itself gets the background?
Pseudo-code for what I mean:
if(ControlBeingPainted == Form){
paint the gradient background
}
else{
base.OnPaintBackground(pevent);
}
Thanks for any help,
Blair
Run into a problem I can't find a solution for. I'm writing a C# app
which has a custom background for the form (a gradient). I've
successfully overridden the forms OnPaintBackground(PaintEventArgs
pevent) method to paint the background.
However, it seems that some of the controls on the form (such as the
labels) also call this method and hence get painted with the gradient.
Is there some way I can tell what control (or type of control) is being
painted, so only the form itself gets the background?
Pseudo-code for what I mean:
if(ControlBeingPainted == Form){
paint the gradient background
}
else{
base.OnPaintBackground(pevent);
}
Thanks for any help,
Blair