Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

Bold Text using DLGSET

rtsmith
Beginner
893 Views
I am using DLGSET to write text in alist box in adialog window. I now want to print some of the lines of text in bold but cannot find how to do it. I do not seem to be able to use SETFONT/OUTGTEXT because I am writing to a specific part of the dialog window. How do I use bold text using DLGSET?
0 Kudos
2 Replies
anthonyrichards
New Contributor III
893 Views
It would appear that Windows uses the SYSTEM_FONT to write text to dialog box windows, so you need to be able to play with this font's properties, or set another font for the dialog box control . The latter will require windows API functions and sending a WM_SETFONT message to the control and processing it. I tried looking at the system font in Start..settings..control panel..display..appearance on my WIndows 2000 machine, but the font specified there affects ALL the text in a dialog (static and edit box text), and cannot be made bold there. Similarly, there are a limited set of fonts you can set in the dialog box properties in resource editor, again affecting ALL the text in a dialog, and making it bold was not one option anyway..
0 Kudos
Jugoslav_Dujic
Valued Contributor II
893 Views
XFLOGM 2.0 (part of XFT library) supports DLG_FONT control index, whose character value looks like "t'Arial'h8".
As Tony suggested, you can change the font using DlgSendCtrlMessage(WM_SETFONT), but you have to obtain handle to the font using CreateFont(Indirect) API, and also pay attention to DeleteObject(hFont) once you don't need it anymore (e.g. after dialog exits).
However, in any case you cannot have a mix of fonts within single list control. (You can owner-draw it, but that can get moderately complicated).
Jugoslav
0 Kudos
Reply