NO

Author Topic: static text height  (Read 3175 times)

golite

  • Guest
static text height
« 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.

Offline TimoVJL

  • Global Moderator
  • Member
  • *****
  • Posts: 2115
Re: static text height
« Reply #1 on: October 02, 2013, 05:03:36 PM »
At runtime use CreateFont and SendMessage WM_SETFONT

From silly example
Code: [Select]
...
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);
...
« Last Edit: October 02, 2013, 05:59:53 PM by timovjl »
May the source be with you

Offline jj2007

  • Member
  • *
  • Posts: 536
Re: static text height
« Reply #2 on: October 02, 2013, 06:19:07 PM »
Try also
SendDlgItemMessage(hwndDlg, 4001, WM_SETFONT, (WPARAM)GetStockObject(ANSI_VAR_FONT), TRUE);

golite

  • Guest
Re: static text height
« Reply #3 on: October 03, 2013, 08:08:10 AM »
Thanks Again. The explanation and the sample zip file worked wonders for my learning.