How to apply a specified font style selected in a font dialog to a text box in visual basic.
I’m trying to implement a notepad program that provides the ability to choose the desired font (from a list of available fonts), and then I want to apply this font to the text in the TextBox.
I have done this so far
FontDialog1.ShowDialog()
TextBox1.Font = FontDialog1.Font
But it didn’t work.
You would have to set all Font-related properties of the TextBox from the
System.Drawing.Fontthat is returned by the FontDialog.Font property:See also this question.