FontDialog Controller in Visual Basic .Net

FontDialog Controller in VB.NET can be used to change Fonts in your application. So user can select the Font Type,Size,Color etc
You can see the FontDialog control on the Dialogs section of the ToolBox. You can drag and drop this control to the form

Now We will try to implement following Form
When you open the FontDialog and select font and other properties it will apply the changes to TextBox

So this is the code for opening dialog and applying changes for fonts

Code explanation

  • Line 5 : ShowColor property is to show the colors in FontDialog
  • Line 7 : Check ShowDialog result with Windows.Forms.DialogResult.OK
  • Line 8 : Assign Font value to Font property of the TextBox
  • Line 9 : Assign Color value to ForeColor property of the TextBox

Leave a Reply

Your email address will not be published. Required fields are marked *