VB.NET Property 'Font' is 'ReadOnly' - Please Help!!

VB.NET Property 'Font' is 'ReadOnly' - Please Help!!

Post by Patt » Sat, 06 Jan 2007 02:20:17



I am building an application using VB.NET 1.1 and I have an issue with
Font properties in my Radio Button Lists and Check Box Lists.  My issue
is that the Font Names and Font Size for these controls have become
"Read Only" and I have no idea how they became read only.  I didn't set
anything to read only and was able to change these fonts just last week
- so I must have messed something up.  Below is a snippet of my HTML
code I used to assign the font properties and also my attempt in VB.NET
code:

HTML:

<asp:radiobuttonlist id="rblAuditType" Width="100%" Runat="server"
AutoPostBack="False" Font-Size="XX-Small"                                                                           Font-Name="Tahoma"
RepeatDirection="horizontal" RepeatColumns="3"
Font-Names="Arial"></asp:radiobuttonlist>
<!--No matter what I change the Font-Size or Font-Name too, it always
displays as Arial, X-Small-->

VB.NET
 Me.rblAuditType.Font = New System.Drawing.Font("Tahoma", 8.0F,
System.Drawing.FontStyle.Bold)
'When I try the above code I recieve a compiler error message that says
Property 'Font' is 'ReadOnly'

Any suggestions would be much appreciated!

 
 
 

VB.NET Property 'Font' is 'ReadOnly' - Please Help!!

Post by Patt » Sat, 06 Jan 2007 03:59:28


I am building a web application using VB.NET 1.1 and I am running into
an issue with Font Properties.  My issue is that I cannot change the
Font Name or Font Size on any of my radio button lists or check box
lists.  Below is my HTML code that I'm using for one of my radio button
lists:
<asp:radiobuttonlist id="rblQAType" Width="100%" Runat="server"
Font-Size="X-Large" autopostback="true"
                                                                                                RepeatDirection="horizontal" RepeatColumns="2"
Font-Names="courier new"></asp:radiobuttonlist>

As you can see I have set the Font-Size to X-Large and the Font-Name to
Courier New.  However, when I run my application the radio button list
test displays in Arial, x-small text.

I then tried to change the font with VB.NET code, but when I type in
the below I get a compiler message that says Property 'Font' is
'ReadOnly.' :
Me.rblQAType.Font = New System.Drawing.Font("Tahoma", 8.0F,
System.Drawing.FontStyle.Bold)

I don't understand what I did that has made the font properties for my
radio button lists and check box lists read only.  I was able to change
the font of these controls last week, but I must have done something to
put it in read only mode.

Does anyone have any idea on how to take the font properties out of
read only?  Any suggestions would be much appreciated!