473,398 Members | 2,389 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

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

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!

Jan 8 '07 #1
2 6531
when you need to change the font, create a new font object and assign that
to the control...

"Patti" <pd*******@worldsavings.comwrote in message
news:11*********************@51g2000cwl.googlegrou ps.com...
>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!

Jan 10 '07 #2
Thank you very much for responding! I have tried creating a font
object and assigned it to the control, but I continue to get the error
message that the "Property Font is Read Only." Perhaps you can see
what I'm doing wrong. I have tried three different methods below in my
page load.

First attempt:
Dim newfont As Font
newfont = New System.drawing.Font("Arial", 8)

rblQAType.Font = newfont

Second attempt:
Dim num As FontUnit

rblQAType.Font.Name = "arial"
rblQAType.Font.Size = num.Point(6)

Third attempt:
Dim MyFont As New Font("Arial", 6, FontStyle.Regular,
GraphicsUnit.Point)

For Each Control As Control In Me.Controls
Try
rblQAType.Font = MyFont
Catch ex As Exception
End Try
Next

Thanks in advance for any suggestions!
Jeff Jarrell wrote:
when you need to change the font, create a new font object and assign that
to the control...

"Patti" <pd*******@worldsavings.comwrote in message
news:11*********************@51g2000cwl.googlegrou ps.com...
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!
Jan 10 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Phil Powell | last post by:
<? class ErrorMsgCollection { var $name; var $mandatory; var $emptyErr; var $maxLength; var $maxLengthErr; var $minLength; var $minLenghtErr;
0
by: Tony | last post by:
I'm trying to understand how to work with bounding boxes around text with the GD2 library. I thought I understood the concepts and wrote a simple program to make sure. Here it is: <?php...
0
by: hesing Qiang | last post by:
In Print Process,I use the code,but it is not run correctly On WINDOWS 98 . I didn't know why ...? this.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular,...
4
by: almurph | last post by:
Hi, Hope I have the right forum here - apologies if I don't. I'm trying to access a ArrayList collection via an indexer inside a class called "collExample" What I want to be able to do is to...
1
by: Ing. Rajesh Kumar | last post by:
I have a UserControl with a TextBox "TextBox_1" and a ReadOnly Property "myText" in it. I am using this in a file (no Code Behind) as follows : HTML: <My:Control ID="txtName" runat="server" /> VB:...
3
by: Moe Sizlak | last post by:
Hi There, I am trying to use the to obtain the information from 2 listmenus, if the user makes a selection the page is submitted and then based on the value selected is transfererd to another...
3
by: Tom | last post by:
I'm using the PropertyGrid, and have it bound to a class object. Works fine - however, I have some properties that I want to show up on the grid (i.e. they are browsable) -YET- I don't want the...
1
by: Steve | last post by:
In my gridview, I have a template column whose 'visible property' I wish to bind to a database field called "TransactionType" which is of a string datatype. I only want the data in this gridview...
4
by: H-S | last post by:
Please help. This is a real puzzler! Originally posted on microsoft.public.dotnet.framework.windowsforms but no answer found! I have a read-only textBox which shows the results of a selection...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.