Solved

BC4.52/Win95:  setting font type in dialog

Posted on 1997-10-01
3
292 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
Comment Utility
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
Comment Utility
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
Comment Utility
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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

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…
Browsers only know CSS so your awesome SASS code needs to be translated into normal CSS. Here I'll try to explain what you should aim for in order to take full advantage of SASS.
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

762 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

9 Experts available now in Live!

Get 1:1 Help Now