title: Error:Property font is read-only in Asp.Net
body: <p>I am really getting out of control with this small problem and unable to rectify it?</p>
  
  <p>Can anyone help me in this!</p>
  
  <p>Here is my code:</p>
  
  <pre><code>Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
      Dim installed_fonts As New InstalledFontCollection
      lstFont.Items.Clear()
      For Each font_family As FontFamily In installed_fonts.Families
          lstFont.Items.Add(font_family.Name)
      Next font_family
      lstFont.SelectedIndex = 0
  End Sub
  
   Private Sub txtSize_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtSize.TextChanged, chkBold.Click, chkItalic.Click, chkUnderline.Click, chkStrikeout.Click, lstFont.SelectedIndexChanged
          ShowSample()
      End Sub
  </code></pre>
  
  <p>Private Sub ShowSample()</p>
  
  <pre><code>' Compose the font style.
  Dim font_style As FontStyle = FontStyle.Regular
  If Bold.Checked Then font_style = font_style Or FontStyle.Bold
  If Italic.Checked Then font_style = font_style Or FontStyle.Italic
  If Underline.Checked Then font_style = font_style Or FontStyle.Underline
  
  
  ' Get the font size.
  Dim font_size As Single = 8
  Try
      font_size = Single.Parse(DropFontSize.SelectedValue)
  Catch ex As Exception
  End Try
  
  ' Get the font family name.
  Dim family_name As String = DropFont.SelectedIndex.ToString
  If Not (DropFont.SelectedItem Is Nothing) Then
      family_name = DropFont.SelectedItem.ToString
  End If
  ' Make the new font.
  Dim new_font As New Font( _
      family_name, font_size, font_style)
  
  ' Set the sample's font.
  TextBox1.Font.Name = new_font.Name
  TextBox1.Font.Size = font_size
  TextBox1.Font.Bold = Bold.Checked
  TextBox1.Font.Italic = Italic.Checked
  TextBox1.Font.Underline = Underline.Checked
  </code></pre>
  
  <p>End Sub</p>
  
  <p>I am getting as Property font is read-only and I have tried many snippets to get rid of this problem but none worked!</p>