The default dialog font and font size is not a part of the CDialog class, but
the dialog template in the .rc file:
IDD_SETUP_LIST_WIDE DIALOGEX 0, 0, 121, 81
STYLE DS_SETFONT | WS_POPUP | WS_THICKFRAME
FONT 8, "MS Sans Serif", 0, 0, 0x0
BEGIN
PUSHBUTTON "x",IDC_BUTTON_1,15,35,90,14
PUSHBUTTON "x",IDC_BUTTON_2,15,49,90,14
LTEXT "x",IDC_DLG_TITLE,4,1,62,18,SS_CENTERIMAGE
PUSHBUTTON "X",IDCANCEL,101,3,16,14,BS_ICON
GROUPBOX "",IDC_STATIC_2,9,22,103,50
END
I'm am aware that you can change the font on an instance of the CDialog
class, but as you write, that doen't give me an generic solution.
The problem is that we are many programmers working an the same application
and it has to be a specific font we use in our dialogs in order to get a
correct and readable appearance when it is localized - especially to
Japanese, Korean etc. We don't want that everybody should remember to change
the font each time they add a new dialog.
Thanks for your continues effort to solve my problem.
Lasse.
[quoted text, click to view] "Peter van der Goes" wrote:
>
> "Lasse K. Christensen" <contex@newsgroup.nospam> wrote in message
> news:3ED39AD8-A991-4D54-954A-3CDC0E91F612@microsoft.com...
> > Thank you for your answer, but it is not the IDE settings I want to
> change. I
> > will try to rephrase:
> >
> > I'm developing an MFC 7.1 based application in Visual Studio C++, using
> > Visual Studio .NET 2003 - but I'm not using managed mode.
> >
> > When I want a new dialog in the application I'm developing I use the
> > ressource editer and choose "Insert Dialog". I can then add buttons,
> static
> > text fields etc. to this new dialog. The dialog has some default
> properties
> > (which I can change too) and among them are the dialog font type and size.
> I
> > can change this font type manually for the dialog but next time I add a
> > dialog I will have to do the same and so on.
> > Here goes my question: Where do I change the default behavior so the
> default
> > font from the start is the font I have chosen to use in my application
> > dialogs?
> >
> > Hopes this clarifies my question.
> >
> > Thanks,
> > Lasse.
> >
> I don't believe you can do what you want to do.
> To do that you would have to alter the CDialog class.
> After you "Insert Dialog" in the Resource Editor, are you then creating an
> extension of the CDialog class to support your resource? If so, you can add
> the necessary code to the constructor to set the properties in question to
> what you want, but that doesn't give you the generic solution you seek.
>
> --
> Peter [MVP Visual Developer]
> Jack of all trades, master of none.
>
>