Home > Software engineering >  MFC TabControl draw horizontal text
MFC TabControl draw horizontal text

Time:09-18

MFC TabControl text drawn horizontally (trouble give a detailed code, baidu's results are based on c #, good sad)

CodePudding user response:

The dc is set the font, but since the draw you change the direction of the font, need to control the size of a label the Rect,

CodePudding user response:

Simple is to set a fixed width, and then directly calls the function set the label size, so since the draw up a simple, I like this,

CodePudding user response:

refer to the second floor accessysq response:
simple is to set a fixed width, and then directly calls the function set the label size, since the draw up so simple, so I figure,

Is there a specific implementation code

CodePudding user response:

//set the font format
Memset (& amp; StFont, 0, sizeof (LOGFONT));
StFont. LfHeight=MulDiv (14, pDC - & gt; GetDeviceCaps (LOGPIXELSY), 72);
StFont. LfWeight=FW_NORMAL;
StFont. LfClipPrecision=CLIP_DEFAULT_PRECIS;
Strcpy (stFont lfFaceName, "@ tahoma" ).

CodePudding user response:

reference guoqiang5277 reply: 3/f
Quote: refer to the second floor accessysq response:

Easy is to set a fixed width, and then directly calls the function set the label size, so since the draw up a simple, I like this,

Is there a specific implementation code

Inside the onpaint SelectObject, font directly extract the parent form font, label size SetItemSize done using Ctabctrl interface function,
Set font don't know if the Windows have direct effect, inside the wince is I had done, not line, so since the draw,

CodePudding user response:

reference 4 floor schlafenhamster response:

//set the font formatMemset (& amp; StFont, 0, sizeof (LOGFONT));
StFont. LfHeight=MulDiv (14, pDC - & gt; GetDeviceCaps (LOGPIXELSY), 72);
StFont. LfWeight=FW_NORMAL;
StFont. LfClipPrecision=CLIP_DEFAULT_PRECIS;
Strcpy (stFont lfFaceName, "@ tahoma" ).

This code is added to the OnPaint function is added to the inside?

CodePudding user response:

reference 5 floor accessysq reply:
Quote: refer to the third floor guoqiang5277 response:

Quote: refer to the second floor accessysq response:

Easy is to set a fixed width, and then directly calls the function set the label size, so since the draw up a simple, I like this,

Is there a specific implementation code

Inside the onpaint SelectObject, font directly extract the parent form font, label size SetItemSize done using Ctabctrl interface function,
Set font don't know if the Windows have direct effect, inside the wince is I had done, not line, so the custom painting,

Just contact with MFC is not long, still look not very understand,,,,

CodePudding user response:

DC is not can use the SelectObject set font? Where don't understand the

CodePudding user response:

refer to the eighth floor accessysq response:
DC is not can use the SelectObject set font? Where don't understand the

Can set the font, but how to set the tabCtrl font? This seems not achieve them

CodePudding user response:

references 9 f guoqiang5277 response:
Quote: refer to the eighth floor accessysq response:

DC is not can use the SelectObject set font? Where don't understand the

Can set the font, but how to set the tabCtrl font? This seems to achieve

Tabctrl font is not something we can use the setfont Settings? Problem is that the dc is useful, must be set as if not set font controls can change it,

CodePudding user response:

references to the tenth floor accessysq response:
Quote: references 9 f guoqiang5277 response:

Quote: refer to the eighth floor accessysq response:

DC is not can use the SelectObject set font? Where don't understand the

Can set the font, but how to set the tabCtrl font? This seems to achieve

Tabctrl font is not something we can use the setfont Settings? Problem is that the dc is useful, must be set as if not set font controls can change it,


I use the code is

The effect of implementation is

CodePudding user response:

references to the tenth floor accessysq response:
Quote: references 9 f guoqiang5277 response:

Quote: refer to the eighth floor accessysq response:

DC is not can use the SelectObject set font? Where don't understand the

Can set the font, but how to set the tabCtrl font? This seems to achieve

Tabctrl font is not something we can use the setfont Settings? Problem is that the dc is useful, must be set as if not set font controls can change it,

Font size can be controlled, but seemingly can't control the font direction,
LogFont. LfEscapement=120;//text lines with the X axis Angle
LogFont. LfOrientation=190;//character in X axis Angle
Set these parameters, the font or stand shows that there is no change at all

CodePudding user response:

Honest custom painting, custom painting directly modify dc font when to go,

CodePudding user response:

reference 13 floor accessysq reply:
honest custom painting, custom painting directly modify dc font, when

How custom painting, can provide a reference code, did not get this stuff before

CodePudding user response:

1 label on the right

CodePudding user response:

CodePudding user response:

nullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnull
  • Related