VC Static控件的文本垂直居中

VS中使用SS_CENTERIMAGE或Center Image让文本垂直居中。

在VC6中,如下地方设置:
VC Static控件的文本垂直居中_第1张图片

反映在rc文件中,多了一个属性:

LTEXT “Static Text”,IDC_STATIC_ID,42,26,104,8, SS_CENTERIMAGE

得到这个属性的名称(Center Image)之后,就清楚在VS2010或类似版本中对应的地方。如下:

VC Static控件的文本垂直居中_第2张图片

属性框中给出的解释:

vs2010_static_center_vertically_note

MSDN的解释:

SS_CENTERIMAGE Specifies that, if the bitmap or icon is smaller than the client area of the static control, the rest of the client area is filled with the color of the pixel in the top left corner of the bitmap or icon. If the static control contains a single line of text, the text is centered vertically in the client area of the control.

你可能感兴趣的:(MFC)