Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6759609
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T13:57:57+00:00 2026-05-26T13:57:57+00:00

I am really getting out of control with this small problem and unable to

  • 0

I am really getting out of control with this small problem and unable to rectify it?

Can anyone help me in this!

Here is my 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

Private Sub ShowSample()

' 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

End Sub

I am getting as Property font is read-only and I have tried many snippets to get rid of this problem but none worked!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T13:57:57+00:00Added an answer on May 26, 2026 at 1:57 pm

    you have to set like below, WebControl.Font Property is read only

    Private Sub ShowSample()
        .....
        Dim new_font As New Font( _
            family_name, font_size, font_style)
    
        ' Set the sample's font.
        txtSample.Font.Name = new_font.Name
        txtSample.Font.Size = Font.Size
        txtSample.Font.Bold = chkBold.Checked
        txtSample.Font.Italic = chkItalic.Checked
        txtSample.Font.Underline = chkUnderline.Checked
        txtSample.Font.Strikeout= chkStrikeout.Checked
    
    End Sub
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Not really getting the point of the map function. Can anyone explain with examples
Can anyone help me with this simple bit of jQuery? I am building a
This is really getting to me now.I have a form that loads when the
Sorry if this is a really basic question but it's been really getting to
This is a really weird problem. It's taken me practically all day to whittle
I've been reading around trying to find out why I'd be getting this exception
So I'm getting really sick of E*TRADE and, being a developer, would love to
What are some options for getting really fast 'Find in Files' searching in VIM?
[Meta-note:] I was browsing the question page, getting really tired of DIVS vs Tables
I'm getting some really wierd linking errors from a class I wrote. I am

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.