Link to home
Start Free TrialLog in
Avatar of Éric Moreau
Éric MoreauFlag for Canada

asked on

TabControl Page Enabled property

I am building an application using Windows Forms (VB.Net 2003).

I need to disable some pages of a tab control depending on users privileges. It seems that the Enabled property disable the content of the tabpage and not the access to the tabpage.

Then I found http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon/html/vbtskdisablingtabpagesprogrammatically.asp which is using the SelectedIndexChange to detect when a tab is selected and switch to another.

There are 2 things that I don't like about this:
1. There is a visual flicking. How can we stop the flicking?
2. There is no visual clues that the tab is not enabled. How can we gray the caption of the tab page?

Or if you have better ideas please tell me!
ASKER CERTIFIED SOLUTION
Avatar of nishikanth
nishikanth

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Éric Moreau

ASKER

You answer my first question correctly and completly. What about the second part ( How can we gray the caption of the tab page? )
I found that you need to set the DrawMode property to TabDrawMode.OwnerDrawFixed and write some code into the DrawItem to be able to change the font or the apprearance of a TabPage caption.
Avatar of nishikanth
nishikanth

glad u could get the complete solution