Setting Textbox to Bold

  • Thread starter Thread starter Wayne Wengert
  • Start date Start date
W

Wayne Wengert

I am trying to set the text in a textbox to Bold but I keep getting an error
that 'Bold" is ReadOnly? My code is as follows:

Dim N As New Form1()



If CheckBox1.Checked = True Then

N.TextBox1.Font.Bold = True

End If
 
The Font object is immutable, i.e. you cannot change it's properties
individually. You can however create a new Font object that is the same in
all other respects as the existing one and assign it to the Font property.
If you keep switching between the two, you may wish to cache the two
objects.

Jem
 
Back
Top