Solved

BC4.52/Win95:  setting font type in dialog

Posted on 1997-10-01
3
306 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
[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
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

Industry Leaders: 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

Article by: Matthew
I am a very big proponent of technology compliance standards and strive to meet such criteria in all of my work. That includes my site, which is 100% XHTML 1.0 compliant as determined by the World Wide Web Consortium. https://www.matthewstevenkel…
SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

691 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