Q:

Changing font name

in vb.net  ,I have a rich text box for write text and a combo box for font names.
i added fonts to combo box with this code:
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    Dim ff As FontFamily
    For Each ff In System.Drawing.FontFamily.Families
        FontName.Items.Add(ff.Name)
    Next
End Sub

But i don't know, how to change the font name of the rich text box.

A:

You have to use the code below:
RichTextBox1.Font = New Font("Font Name", size)

Adapt it to your specific conditions: replace RichTextBox1 with your RichTextBox, "Font Name" with the given item of your ComboBox FontName, size with the size you want (it might be the current one, that is, RichTextBox1.Font.Size).

A:

RichTextBox.Font = New Font(FontName.Text, 10, FontStyle.Regular)

