Changing fonts in listbox & edit controls

I am using MFC to handle a ListBox and an Edit control in my application. When I try to change the font in these controls to "Courier New" the font does not change. Can anyone give me some insight into what may be going on?
LVL 3
jsakhtarAsked:
Who is Participating?
 
mikeblasConnect With a Mentor Commented:
You're setting the font and then destroying it in the CFont destructor. You need to keep the font around for the lifetime of the box.

..B ekiM
0
 
iarlaCommented:
Caan you post the code with which you are trying to do this
0
 
jsakhtarAuthor Commented:
From InitDialog()

CFont font;
font.CreatePointFont(90,
   L"Courier New");
m_listbox.SetFont(&font);
0
 
jsakhtarAuthor Commented:
all I need to do is set the font to a fixed width font
0
All Courses

From novice to tech pro — start learning today.