Pelles C forum

C language => Windows questions => Topic started by: golite on October 02, 2013, 04:38:40 PM

Title: static text height
Post by: golite on October 02, 2013, 04:38:40 PM
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.
Title: Re: static text height
Post by: TimoVJL on October 02, 2013, 05:03:36 PM
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);
...
Title: Re: static text height
Post by: jj2007 on October 02, 2013, 06:19:07 PM
Try also
SendDlgItemMessage(hwndDlg, 4001, WM_SETFONT, (WPARAM)GetStockObject(ANSI_VAR_FONT), TRUE);
Title: Re: static text height
Post by: golite on October 03, 2013, 08:08:10 AM
Thanks Again. The explanation and the sample zip file worked wonders for my learning.