Home All Groups Group Topic Archive Search About

Finding out the width of a tab on the SSTAB control

Author
22 May 2009 5:58 PM
Randem
How would one go about finding out the width of a tab not the tab window,
just the top portion. I need to replace the tab with a control that displays
unicode since the SSTAB control does not support unicode.

--
Randem Systems
Your Installation Specialist
The Top Inno Setup Script Generator
http://www.randem.com/innoscript.html
Disk Read Error Press Ctl+Alt+Del to Restart
http://www.randem.com/discus/messages/9402/9406.html?1236319938

Author
22 May 2009 9:20 PM
Richard Mueller [MVP]
Show quote Hide quote
"Randem" <newsgro***@randem.com> wrote in message
news:O%23452bw2JHA.5816@TK2MSFTNGP02.phx.gbl...
> How would one go about finding out the width of a tab not the tab window,
> just the top portion. I need to replace the tab with a control that
> displays unicode since the SSTAB control does not support unicode.
>
> --
> Randem Systems
> Your Installation Specialist
> The Top Inno Setup Script Generator
> http://www.randem.com/innoscript.html
> Disk Read Error Press Ctl+Alt+Del to Restart
> http://www.randem.com/discus/messages/9402/9406.html?1236319938
>
>
>

If you right click on a tab of the tab control and select properties, you
see a TabMaxWidth property for each tab. I set this to 0, which I guess
means to size the tab according to the size of the TabCaption. My tabs vary
in size depending on the caption. I assume you can set the TabMaxWidth as
desired. If like me you have assigned 0, then you either must guess or find
documentation on how the width is determined from the length (and font) of
the caption.

--
Richard Mueller
MVP Directory Services
Hilltop Lab - http://www.rlmueller.net
--
Author
22 May 2009 10:24 PM
Nobody
"Randem" <newsgro***@randem.com> wrote in message
news:O%23452bw2JHA.5816@TK2MSFTNGP02.phx.gbl...
> How would one go about finding out the width of a tab not the tab window,
> just the top portion. I need to replace the tab with a control that
> displays unicode since the SSTAB control does not support unicode.

If you use TabStrip instead, maybe you can use TCM_GETITEMRECT, but I think
it's for the whole tab. However, TabStrip supports Unicode when you send
TCM_SETUNICODEFORMAT, and then set the text using TCM_SETITEMW. Pass the
string as "ByVal StrPtr(s)" so VB doesn't convert the string to ANSI. I
think you need to use SendMessageW() instead of SendMessage(). Search the
newsgroups for these messages for samples. I haven't tried this, so proceed
at your own risk...