Change Text Font - Visual Basic .NET

Tags: VB.NET, VB 2008, VB 2010, VB 2012, VB 2013

For this tutorial you need a FontDialog and a Button and a label

visual basic font dialog

When a user clicks on the button, the FontDialog will show up and the user will choose the font style, size then clicks Ok

Then the label font will change according the choice made:

change font in visual basic .net

Below is the code of the Button Click Event:

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
	FontDialog1.ShowDialog()
	Label1.Font = FontDialog1.Font
End Sub

change font in vb .net


Share This

Home | About | Contact | Privacy Policy

Copyright visual-basic-tutorials.com 2017 - All Rights Reserved.