Font size on components in a dialog box.

I would like to change the font size on the text in edit boxes or/and static text boxes. The only change i have been able to make is through properties of the dialog box where i set the font for all of the items of the dialog box, although i cannot set bold for example, but i would like to set the fonts for the text boxes differently than the whole dialog box. I see no such similar capability in the properties of the text box. Is there a way to do this, either via program code or through the properties of the text box ? Thanks.

// get next control hControl = GetWindow(hControl, GWL_HWNDNEXT); }[/code]

: I would like to change the font size on the text in edit boxes or/and static text boxes. The only change i have been able to make is through properties of the dialog box where i set the font for all of the items of the dialog box, although i cannot set bold for example, but i would like to set the fonts for the text boxes differently than the whole dialog box. I see no such similar capability in the properties of the text box. Is there a way to do this, either via program code or through the properties of the text box ? Thanks.:

Thanks for the information. But if i just want to create a font for a specific control such as a static text box, and no other, how do i get the handle for the font ? Do i first get a device handle GetDC then a handle to the font? I have looked at some of the sample code in Petzold and it seems rather intricate - and since i would like to apply that to one single control - i would like an easier way of setting the font for that control. Any examples ? : via code, you need to send the hFont to the control windows via WM_SETFONT. Check it out in MSDN.: : If you want all text boxes to be of a certain font, all labels of another, etc, then you might write some code like this:: : [code]: INT WINAPI DialogProc(HWND hDlg, ...: {: switch(message): {: case WM_INITDIALOG:: {: // enumerate all children: HWND hControl = GetWindow(hDlg, GW_CHILD);: while(hControl != null): {: // get the class name: TCHAR className[800];: GetClassName(hControl, className, sizeof(className));: : // set the font based on class: if(lstrcmpi(className, "edit") == 0): SendMessage(hControl, WM_SETFONT, hEditBoxFont, 0);: else if(lstrcmpi(className, "static") == 0): SendMessage(hControl, WM_SETFONT, hStaticFont, 0);: : // get next control: hControl = GetWindow(hControl, GWL_HWNDNEXT);: }: [/code]: : : : : I would like to change the font size on the text in edit boxes or/and static text boxes. The only change i have been able to make is through properties of the dialog box where i set the font for all of the items of the dialog box, although i cannot set bold for example, but i would like to set the fonts for the text boxes differently than the whole dialog box. I see no such similar capability in the properties of the text box. Is there a way to do this, either via program code or through the properties of the text box ? Thanks.: : : :