- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
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
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page