Solved

BC4.52/Win95:  setting font type in dialog

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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Most of the sites are being standardized with W3C Web Standards. W3C provides lot of web standard services to the web. They have the web specification, process and documentation for all the web standards. You can apply HTML, CSS and Accessibility st…
I will show you how to create a ASP.NET Captcha control without using any HTTP HANDELRS or what so ever. you can easily plug it into your web pages. For Example a = 2 + 3 (where 2 and 3 are 2 random numbers) Session("Answer") = 5 then we…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

776 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