Nevron Forum

NTabControl.Invalidate not working on tabs

https://www.nevron.com/Forum/Topic5839.aspx

By Brad Swearingen - Wednesday, November 9, 2011

I've added a custom renderer to my NTabControl to paint certain tabs a different color at times.  This works fine and was easy to add.

However, when I need to indicate that my tab needs to be redrawn with the new color I call the NTabControl.Invalidate() method and the tabs don't get invalidated.  (I saw there was a NTabPage.Invalidate() method too but it doesn't redraw the tab either.) 

For the moment, instead, I'm setting the NTabControl.Visible to false and then back to true to get the tabs to be invalidated.  How does one invalidate the tab area of an NTabControl?  I'm on Win7 using the 11.1.17.12 build.

By Nevron Support - Thursday, November 10, 2011

Hi Brad,

Have you try nTabControl.Invalidate(true)?

By Brad Swearingen - Friday, November 11, 2011

Thanks, I had not tried that and it worked.  I was converting code that did something similar using an ownerdraw Windows.Form tab control and all it needed was the Invalidate() call to redraw its tabs.  Not a big deal but thought I would report it.