disable a tabpage control


G

Guest

I would like to disable a TabPage control so that my users can see that the page exists, but the selected index of the TabControl won't change if they click on the tab for it. Ideally, the TabPage's text would be displayed in the same format as, say, a disabled label.

The knowledge base says that disabling a TabPage doesn't work (by design) but it doesn't seem like it should be that hard to me.

Thanks,
 
Ad

Advertisements

M

Mick Doherty

That's included in the source for:
A Completely OwnerDraw TabControl
http://homepage.ntlworld.com/mdaudi100/alternate/tabcontrols.html

Or you may like to use my TabControlEx in place of the standard one.
http://homepage.ntlworld.com/mdaudi100/alternate/controls.html

--
Mick Doherty
http://homepage.ntlworld.com/mdaudi100/alternate/home.html


pmcguire said:
I would like to disable a TabPage control so that my users can see that
the page exists, but the selected index of the TabControl won't change if
they click on the tab for it. Ideally, the TabPage's text would be
displayed in the same format as, say, a disabled label.
The knowledge base says that disabling a TabPage doesn't work (by design)
but it doesn't seem like it should be that hard to me.
 
G

Guest

Great control Ken. The only thing I've been unable to get around is it's handling of long TabPage.Text strings. They get wrapped unexpectedly. I have SORT OF handled it by padding my strings with " "'s but that is clearly not a good solution. I've tried inflating the e.bounds property in the OnDrawItem override, but it doesn't work, it seems I should be handling some event that fires before OnDrawItem, but I have no idea what that event is. Any suggestions?

Thanks
 
K

Ken Tucker [MVP]

Hi,

Thanks. I will have to look into the handling of long strings.

Ken
--------------
 
G

Guest

Let me know if you need particulars regarding how to reproduce the behavior.
 
Ad

Advertisements


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