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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I change the font of an edit box?

Status
Not open for further replies.

Difflam

Programmer
Joined
Jul 3, 2002
Messages
1
Location
AU
I've created an edit box within a window using the following code:

hEdit = CreateWindow(L"EDIT",name,WS_VISIBLE | WS_BORDER | ES_CENTER | ES_READONLY | ES_MULTILINE,
LEFTMARGIN, // x
HEADER, // y
WIDTH - LEFTMARGIN - RIGHTMARGIN, // width
OBJECTHEIGHT, // height
hwnd,IDC_EDIT,hinst,NULL);

Where the variable "name" is the text which needs to appear in the edit box. What I need to do is change the font of this text, or more specifically, make it BOLD. How would I go about this? Please note, my programming knowledge if fairly shakey so please try and make your responses not too cryptic :)
 
Why don't you try the question as well as answers of the problem which i posted here 2 days back.
1.i repeat first crate a font initially using CreateFont()...
2.Give the attributes as desired then prepare a callback for that window...
3.Then in InitDialog of that callback use WM_SETFONT for the edit window like SendMessage(hStatic,WM_SETFONT,(WPARAM)rowCol.m_BoldFontDlg,TRUE) where hStatic is a static control.
hope this helps
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top