Solved

Why this abnormal behaviour?

Posted on 1998-06-04
3
244 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Best tools for Backup and restore of Wordpress site 6 58
fix34  challenge 9 164
unix example issues 18 106
Problem to Office 1 42
Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
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.
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

756 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