Solved

Why this abnormal behaviour?

Posted on 1998-06-04
3
241 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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
VB.NET how to use the Vertical ScrollBar 5 103
Expand macro to ask for filename column 8 37
fizzArray2 challenge 1 79
JQuery serialize and unserialize 8 83
Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
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.
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

770 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