changing the appearance of Tab in tab control
-
In my application, I want to change the appearance of the tab (not the tab page itself) (i.e. font of Tab text, background of the tab etc.). I know I need to set the draw mode property of the tab control to owner mode and handle the drawitem event. But drawitem event fires at the time when tabs are drawn. Once my application is up and running I'm not drawing the tab. Can any one pls let me know how i can change the appearance of the tab at runtime? e.g. I have got one button on my tab page and if I click that button the back color of tab should change. thanks,
-
In my application, I want to change the appearance of the tab (not the tab page itself) (i.e. font of Tab text, background of the tab etc.). I know I need to set the draw mode property of the tab control to owner mode and handle the drawitem event. But drawitem event fires at the time when tabs are drawn. Once my application is up and running I'm not drawing the tab. Can any one pls let me know how i can change the appearance of the tab at runtime? e.g. I have got one button on my tab page and if I click that button the back color of tab should change. thanks,
Hello,
KrunalC wrote:
I know I need to set the draw mode property of the tab control to owner mode and handle the drawitem event.
You should stay at this solution. At the button click, you could use the TabControl.Refresh() method. This will redraw the TabControl and it's TabPages. All the best, Martin
-
Hello,
KrunalC wrote:
I know I need to set the draw mode property of the tab control to owner mode and handle the drawitem event.
You should stay at this solution. At the button click, you could use the TabControl.Refresh() method. This will redraw the TabControl and it's TabPages. All the best, Martin
Thanks for the reply. Problem was because of my false understanding. I was under impression that tab of the page is part of tabpage and not the tabcontrol. so I was updating the tabpage in draw item rather than tab control. With the tab control update things are working.
-
Thanks for the reply. Problem was because of my false understanding. I was under impression that tab of the page is part of tabpage and not the tabcontrol. so I was updating the tabpage in draw item rather than tab control. With the tab control update things are working.