News:

Download Pelles C here: http://www.smorgasbordet.com/pellesc/

Main Menu

static text height

Started by golite, October 02, 2013, 04:38:40 PM

Previous topic - Next topic

golite

How do I change the text height of the static label?
It defaults at 13 and I need 8. I've looked everywhere in the API and I know I'm just missing it.

TimoVJL

#1
At runtime use CreateFont and SendMessage WM_SETFONT

From silly example
...
hFont = CreateFont(nSize, 0, 0, 0, FW_BOLD, 0, 0, 0, ANSI_CHARSET, 0, 0, 0, 0, TEXT("Ariel"));
SendDlgItemMessage(hwndDlg, 4001, WM_SETFONT, (WPARAM)hFont, TRUE);
...
May the source be with you

jj2007

Try also
SendDlgItemMessage(hwndDlg, 4001, WM_SETFONT, (WPARAM)GetStockObject(ANSI_VAR_FONT), TRUE);

golite

Thanks Again. The explanation and the sample zip file worked wonders for my learning.