To choose a font using FontDialog in C# and VB.NET you can use the following snippet.
Sample C#
using (var dialog = new FontDialog()) { if (dialog.ShowDialog() != DialogResult.Cancel) { textBox1.Font = dialog.Font; } }
Sample VB.NET
Using dialog = New FontDialog() If dialog.ShowDialog() <> DialogResult.Cancel Then textBox1.Font = dialog.Font End If End Using
RT @CodeSnippetsNET: How to choose a font using FontDialog in .NET http://t.co/gQ1Lc1CS9H #csharp #vb #dotnet