Problem with invalidate

  • Thread starter Thread starter Steve B.
  • Start date Start date
S

Steve B.

Hi,

I have a TabControl with some TabPage with custom Paint event handler.

If I call this.Invalidate() from the form containing the tabcontrol, the
tabpage paint event is not called.

The first load of the form correctly call the paint eventhandler...

Is there any known issue about this ?

Thanks,
Steve
 
So you have a form with a tabcontrol/tabpages. You are handling the Paint
event of the TabPage. You then want to force a paint of the tabpage *but*
you are trying to do that by calling Invalidate on the form, right? Why are
you not calling Invalidate on the tabpage instance itself then?

Cheers
Daniel
 
I do, but it is easier to call a "Invalidate" than knowing exactly in which
tabpage the label is. I actually use a generic mecanism to draw label with
custom render that causes the labels to be removed from the control tree (a
working mecanism to allow label to have transparent background), the side
effect is I cannot call lbl.Parent.Invalidate().

I supposed invalidating the top level control (the form) shoud fire the
painting of all nested controls... why am I wrong ?

Thanks,
Steve
 
Back
Top