all groups > visual studio .net setup > october 2004 >
You're in the

visual studio .net setup

group:

Default font in dialog ressources


Default font in dialog ressources Lasse K. Christensen
10/11/2004 4:51:01 AM
visual studio .net setup:
When I add a new dialog ressource the new dialog has a default font. How do I
RE: Default font in dialog ressources Lasse K. Christensen
10/12/2004 2:31:06 AM
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.


[quoted text, click to view]
Re: Default font in dialog ressources Lasse K. Christensen
10/12/2004 7:15:05 AM
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]
Re: Default font in dialog ressources Peter van der Goes
10/12/2004 8:37:13 AM

[quoted text, click to view]
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.

RE: Default font in dialog ressources v-wendyd NO[at]SPAM online.microsoft.com
10/12/2004 8:37:25 AM
Hi,

Thank you for your post!

From your description, I understand that you would like to change the font
of the dialog.

For dialog in Visual Studio .NET 2003 IDE, please follow the steps below to
change the font.

Under "Tools" | "Options" | "Environments" | "Font and Colors", I think we
do have the option to change the dialog fonts in VS.Net 2003 IDE. There is
a combo box named "Show settings for". We can select the settings for
different components of the IDE here: For example, to change the fonts of
dialogs, we can select "Dialog and Tool Windows" here.

If not for VS 2003 IDE, I think for other dialogs, it depends on coding or
system setting.

Regards,

Wendy Dong
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
Re: Default font in dialog ressources Lasse K. Christensen
10/13/2004 4:09:02 AM
Do I understand this right: Your advise is to alter the local users settings
in registry at installation time. But what if other applications use this
font???? And what if an application installed at a later time also follow
your advise and alter the same settings!!!???!!!

[quoted text, click to view]
Re: Default font in dialog ressources v-garych NO[at]SPAM online.microsoft.com
10/13/2004 8:58:32 AM
Hi Lasse,

The default dialog font could not be customized in the VS.NET IDE, it is a
specific font which mapped into MS Shell Dlg, which can be specified in
either the Setup file during the installation process or when customizing a
local system by double-clicking Control Panel's Regional Options icon:
MS Shell Dlg
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/intl/nls_4q
cn.asp

So it appears you needn't to change the new inserted dialog's font on the
design time.

By the way, If you want to change this mapping font at design-time, maybe
you can run a helper program to change the font that specified in the
corresponding registry subkey or change the MFC wizard dialog template(we
don't recommended) directly...


Thanks for your understanding!

Best regards,

Gary Chang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
Re: Default font in dialog ressources v-garych NO[at]SPAM online.microsoft.com
10/14/2004 8:42:20 AM
Hi Lasse,

[quoted text, click to view]

no, I do not mean to change the registry setting of your program's
installation machine, the installation machine would has its own local font
mapped as MS Shell Dlg, I just mean if you want to change the default font
of dialog at design time(what you want in the original message, am I
right?), you can change the registry setting in your develpoment machine...


Thanks!

Best regards,

Gary Chang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
Re: Default font in dialog ressources v-garych NO[at]SPAM online.microsoft.com
10/16/2004 2:18:59 AM
Hi Lasse,

Have I made myself clear this time:-)
If you have any more concerns on it, please feel free to post here.


Have a nice weekend!

Best regards,

Gary Chang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
AddThis Social Bookmark Button