Solved

BC4.52/Win95:  setting font type in dialog

Posted on 1997-10-01
3
299 Views
Last Modified: 2013-12-26
I am writing a Win32 Win95 app using BC4.52, and am trying to set the font type for a dialog by using the FONT command in my resource file.  The file builds OK, but the resulting executable ends up using the system font no matter what font I select.  Is this a problem between Win95 and BC4.52?  If so, is there a work-around?
0
Comment
Question by:danbind
3 Comments
 
LVL 3

Expert Comment

by:msmits
ID: 1299416
I have tried this with 5.02 and found that the fonts in the Dialog changed to what I said they should be.
Maybe you can post the resource code that you are using.

0
 
LVL 3

Accepted Solution

by:
JPM earned 100 total points
ID: 1299417
You have to making a call to GetStockObject in your Dialog SetupWindow for each new member
Example :
in SetupWindow :

TDialog::SetupWindow()
myStaticText1->SetWindowFont( (HFONT)                   GetStockObject(OEM_FIXED_FONT) , TRUE );
//  myStaticText1 was first cretad with new in Constructor
   
See OnLine Help for GetStockObject, you 'll see that Windows take SYSTEM_FONT (default value)

Hope this will help
Jean-Paul
0
 

Author Comment

by:danbind
ID: 1299418
This answer solves my problem--thanks!  BTW, the FONT parameter in the DIALOG statement DOES work (I misspoke), but is limited--the font weight defaults to "Bold".  The Borland documentation says to use the WM_SETFONT message at runtime to set the font otherwise.  Does version 5 have this limitation?
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
Getting Started on web Development for an experienced C++ developer 7 142
Visitor to Web site (Log showing Strange IP Address) 9 124
Microsoft Edge 9 106
Problem to echo 6 115
Preface This is the third article about the EE Collaborative Login Project. A Better Website Login System (http://www.experts-exchange.com/A_2902.html) introduces the Login System and shows how to implement a login page. The EE Collaborative Logi…
Introduction Since I wrote the original article about Handling Date and Time in PHP and MySQL (http://www.experts-exchange.com/articles/201/Handling-Date-and-Time-in-PHP-and-MySQL.html) several years ago, it seemed like now was a good time to updat…
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

726 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