Solved

Why this abnormal behaviour?

Posted on 1998-06-04
3
234 Views
Last Modified: 2013-11-20
Hi MFC gurus,

I have a CFormview with 5 edit controls. I want to set the font of these edit controls with a font selected from a CFontDialog. For this I used SetFont method of CWnd. Font is getting changed but if I bring my focus to any of the edit control back, the font changes back to system font. Why this abnormal behaviour?

0
Comment
Question by:chacko
  • 2
3 Comments
 
LVL 15

Accepted Solution

by:
Tommy Hui earned 50 total points
ID: 1315985
It sounds like your font is being destroyed somehow. Make sure the font object you're using is not created on the stack. The easiest way to create a font you need for the dialog, is to create a font data member in your dialog class. In the constructor for the dialog, create the font. Then in the OnInitDialog, set the font for the edit controls.
0
 
LVL 1

Author Comment

by:chacko
ID: 1315986
Thank! It works....
0
 
LVL 1

Author Comment

by:chacko
ID: 1315987
Thanks! It works....
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
configuration management 2 100
Unix / Linux grid computing 5 127
ODBC Connection Logging, ADO.NET 6 49
dog bark java program 15 82
Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now