Link to home
Start Free TrialLog in
Avatar of bob_online
bob_online

asked on

Add a checkbox to a tab in a tab control

I need a visual indicator that a tab contains data.  I was thinking of either a checkbox on each tab (which would be checked if that tab had data) or a bitmap.

Anyone know how I can put a control on a tab and have it visible whether or not the tab is selected?

The checkbox goes behind the tab if it is not the current tab....
Avatar of rspahitz
rspahitz
Flag of United States of America image

You can always try putting the checkbox OUTSIDE the tab control (and with a ZOrder of vbBringToFront.)  This simply means that you must manually (or programmatically) align it whenever the tab control moves.
Avatar of Nitin Sontakke
See if you have an access to the font information of the tab text. If yes, change colour of it or make it italic, etc.

The tab caption text becomes bold when active, so it is out of question.


ASKER CERTIFIED SOLUTION
Avatar of gencross
gencross

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
FYI

The MS tabbed control was originally the Sheridan SSTab control, which was an enhancement of the TabStrip.

To get the tab strip to work, you basically added a bunch of frames to represent the different tab areas.  Each one that was not selected got shoved off the screen.

When you add a checkbox to the SSTab, it goes into the tab frame area that gets shoved off the screen when you select a different tab.

--
The picture idea indicated above seems to work if you don't mind the picture on the left of the text.

You can also simply add extra text to indicate something is there, like (*).

Otherwise, my checkbox idea outside the tab container would also work.
Seems to me that if there was no data you could disable the tab.

tabcontrol.TabEnabled(tabnumber) = false

Avatar of gencross
gencross

ventond,

If you disable the tab then you cannot select the tab to enter data in any controls within the tab.  I assume data would be entered in the tab.  If not then this solution works.  The Asterick idea sounds like a good one as well.
Avatar of bob_online

ASKER

The picture idea works best.  Thanks -- I didn't know you could do that.
Just as an afterthought, i would like to add something.

I was in big favour of showing images in place of disabled controls. I used to do it mostly on web-forms where the real controls will post their values, even if you don't want to.

However, with the release of Windows XP, now that OS has changed the appearance of controls, if i have an actual control and an image, both on same page, it looks a bit odd.

I simply wanted to share this with you.

Nitin.