Link to home
Start Free TrialLog in
Avatar of 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
Avatar of David Johnson, CD
David Johnson, CD
Flag of Canada image

do you have the source code? if so open the solution in Visual Studio. click on the control and look at its properties.
That should be a system setting for a standard message box.  You can look at the font settings to determine which it is.
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.
Avatar of Darren
Flag of Ireland image

Link to home
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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.

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


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 :


So, technically, is this the system font. If so, can we change it ?
As it is a system setting I would strongly recommend you do NOT change it.
Avatar of ankurdk


Again, I thank all for their prompt valuable inputs.