Éric Moreau
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!
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
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.
glad u could get the complete solution
ASKER