Set a control font with FontDialog

Microsoft .NET Framework, ASP.NET, Visual C# (CSharp, C Sharp, C-Sharp) Developer Training, Visual Studio


Jump to: navigation, search
C# Code Snippets

C# Source Code Bank

See also …
edit

This C# code snippet sets the font in a forms control using the FontDialog class.

using System.Windows.Forms;
...
FontDialog fontDialog = new FontDialog(); 
if ( fontDialog.ShowDialog() != DialogResult.Cancel )
{
   textBox.Font = fontDialog.Font;
}

Today's Deals: Electronics

Personal tools