Second Post: Tab Control Vertical Drawing Problem 
Author Message
 Second Post: Tab Control Vertical Drawing Problem

Hi - I'm posting this for the second time. I didn't get
much response the first time around... TIA

/************************************/

Hi all. I've run into a problem with MFC's tab control. I
have a tab control in one of the dialog bars in my app.
When I modify the style of the tab control to TCS_VERTICAL
using:
    m_tabCtrl.ModifyStyle( TCS_VERTICAL, NULL,
SWP_SHOWWINDOW );

the tabs move to the left side, as they should, but the
text in each tab still draws horizontally; meaning, I only
get about 2 letters of the tab label in before it gets cut
off by the rest of the control.

Strangely enough, this only happens if I set the font of
the tab control when I first create it. If I don't set the
font using:

    m_tabCtrl.SetFont( CFont::FromHandle(
(HFONT) ::GetStockObject( DEFAULT_GUI_FONT ) ) );

and let it use the system font, it draws properly, but the
tab text is HUGE, and quite ugly.

I tried creating the tab control with TCS_OWNERDRAWFIXED
and drawing the text myself, but wasn't getting the most
desirable results.

If anyone has any suggestions on how to get around
this "issue", or how to draw rotated text in a tab
properly, I'd sure appreciate it.

Thanks!
Diarrhio



Sun, 07 Dec 2003 23:54:46 GMT  
 Second Post: Tab Control Vertical Drawing Problem
Try creating a font with a 900-unit rotation and escapement. That's 90
degrees, and should cause it to draw properly. I'm sort of guessing at
this one.
                        joe



Quote:
>Hi - I'm posting this for the second time. I didn't get
>much response the first time around... TIA

>/************************************/

>Hi all. I've run into a problem with MFC's tab control. I
>have a tab control in one of the dialog bars in my app.
>When I modify the style of the tab control to TCS_VERTICAL
>using:
>    m_tabCtrl.ModifyStyle( TCS_VERTICAL, NULL,
>SWP_SHOWWINDOW );

>the tabs move to the left side, as they should, but the
>text in each tab still draws horizontally; meaning, I only
>get about 2 letters of the tab label in before it gets cut
>off by the rest of the control.

>Strangely enough, this only happens if I set the font of
>the tab control when I first create it. If I don't set the
>font using:

>    m_tabCtrl.SetFont( CFont::FromHandle(
>(HFONT) ::GetStockObject( DEFAULT_GUI_FONT ) ) );

>and let it use the system font, it draws properly, but the
>tab text is HUGE, and quite ugly.

>I tried creating the tab control with TCS_OWNERDRAWFIXED
>and drawing the text myself, but wasn't getting the most
>desirable results.

>If anyone has any suggestions on how to get around
>this "issue", or how to draw rotated text in a tab
>properly, I'd sure appreciate it.

>Thanks!
>Diarrhio

Joseph M. Newcomer [MVP]

Web: http://www3.pgh.net/~newcomer
MVP Tips: http://www3.pgh.net/~newcomer/mvp_tips.htm


Mon, 08 Dec 2003 04:08:01 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Tab Control Vertical Drawing problem

2. Owner Drawn Tab Control Problem

3. Tab Control with vertical buttons and horzontal text

4. Vertical tab control

5. Owner drawn tab control

6. owner draw tab control

7. owner drawn tab control

8. Owner Draw Tab Control

9. Draw over tab control

10. Owner Drawn Tab Controls

11. Draw over tab control

12. Help - Problems with Drawing an MFC ActiveX control inside on ATL compsoite control

 

 
Powered by phpBB® Forum Software