Problem with invalidate

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
 
D

Daniel Moth

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
 
S

Steve B.

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
 

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

Top