Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

TextOut - Font (no MFC)

Status
Not open for further replies.

lGOOODl

Programmer
Dec 4, 2001
31
DK
Hi,

Im using alot of text in my program, but is't not so funny to look at when it has the same Font(I know how to change the Color). so how can i change the font!

Tanks
-=<GOOOD>=-
 
For changing the text you will have to do

HDC hDC=GetDC(hWnd);
HFONT hFontOld;
HFONT hFont;

//.. here you specify the desired aspect for your font (HFONT)
//then you select it in the DC
hFontOld = SelectObject(hDC, hFont);

...when you are finished drawing text

// restore the oldfont in the DC
Select(hDC, hFontOld);

Use The DrawText function instead of TextOut. It allows ou to specify the text alignment and other nice stuff. s-)

Blessed is he who in the name of justice and goodwill, sheperds the weak through the valley of darkness...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top