Centre Text in rectangle

Hi,

Coming to the forum after searching what ever resources I thought of.

My query is how to centre text (horizontally and vertically ) in a rectangle ,
Below is a screen capture and then the code I am using, horizontal cetreing seems OK !.

image

GfxSetBkMode(1);
GfxSelectPen(colorBlue,2,0); GfxSelectSolidBrush(colorSkyblue); 	GfxRoundRect(500,200,1000,300,2,2);		
GfxSetTextColor(colorBlack); 	GfxSelectFont("BRITANNIC BOLD",12); 		
GfxDrawText( "HOW ARE YOU", 500,200,1000,300, 1 + 4);

Thanks

Try this:

GfxDrawText( "HOW ARE YOU", 500,200,1000,300, 1 + 4 + 32);
2 Likes

@TrendSurfer

It works, thanks a lot, specifically for the prompt solution .

1 Like