Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.

Text size on pushbuttons

michael_green
Beginner
433 Views
I am using CreateWindow to create a series of checkboxes having the pushbutton style as follows:

hWndpbT(i) = CreateWindow('BUTTON'C,trim(text)//char(0), &
IOR(WS_VISIBLE, &
IOR(WS_CHILD, &
IOR(BS_AUTOCHECKBOX, &
IOR(BS_LEFT, & BS_PUSHLIKE)))),0,row,100,20,hWnd, &
null,ghInstance,null)

Is there any way in which I can control the size and/or font of the text displayed on the buttons? It is currently much too large and means the buttons have to be too large also.

With many thanks in advance

Mike
0 Kudos
1 Reply
Jugoslav_Dujic
Valued Contributor II
433 Views
You can CreateFont(Indirect) and send WM_SETFONT to hwndButton.
For some (historical?) reasons, controls created via CreateWindow by default have an odd-looking font (usu. MS Sans Serif Bold I think). Probably, you want the "standard" GUI font whose handle can be retrieved by GetStockObject(DEFAULT_GUI_FONT), thus:
i = SendMessage(hWndpbT(i), WM_SETFONT, &
GetStockObject(DEFAULT_GUI_FONT), 1)
should do the trick.
Jugoslav
0 Kudos
Reply