Avatar of ankurdk
ankurdk
 asked on

Determine the font of the messageboxes

Hi All,

I have a very basic Windows based .net application in which I have used messageboxes.  How can I determine/know the font of the messageboxes ?

OS used : Windows Server 2008 r2
.NET ProgrammingWindows OSFonts Typography

Avatar of undefined
Last Comment
ankurdk

8/22/2022 - Mon
David Johnson, CD

do you have the source code? if so open the solution in Visual Studio. click on the control and look at its properties.
AndyAinscow

That should be a system setting for a standard message box.  You can look at the font settings to determine which it is.
Fernando Soto

Hi ankurdk;

The MessageBox only has a few properties that are available to be set or gotten but the Font is not one of them. So in answer to your question you can't. If you need that functionality you will need to create your own dialog box.
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy
ASKER CERTIFIED SOLUTION
Darren

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Chinmay Patel

Hi ankurdk,

If you used MessageBox.Show method and did not have your own custom message boxes or (any other mechanism to override default system behavior) - your messagebox would use the fonts defined by the system.

Regards,
Chinmay.
Don VonderBurg

The standard MessageBox has limited settings. I wrote my own MessageBox routine and use that in all cases. I have more control that way.
ankurdk

ASKER
Thanks All for your insights.  As precisely put by @Darren, there is a property SystemFonts.MessageBoxFont which does give the name of the font (in this case it is Tahoma) using the following VB.NET code :

Messagebox.Show(SystemFonts.MessageBoxFont.ToString)

So, technically, is this the system font. If so, can we change it ?
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
AndyAinscow

As it is a system setting I would strongly recommend you do NOT change it.
ankurdk

ASKER
Again, I thank all for their prompt valuable inputs.