473,657 Members | 2,727 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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:radiobutto nlist id="rblAuditTyp e" Width="100%" Runat="server"
AutoPostBack="F alse" Font-Size="XX-Small"
Font-Name="Tahoma"
RepeatDirection ="horizontal " RepeatColumns=" 3"
Font-Names="Arial"></asp:radiobutton list>
<!--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 6565
when you need to change the font, create a new font object and assign that
to the control...

"Patti" <pd*******@worl dsavings.comwro te in message
news:11******** *************@5 1g2000cwl.googl egroups.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:radiobutto nlist id="rblAuditTyp e" Width="100%" Runat="server"
AutoPostBack="F alse" Font-Size="XX-Small"
Font-Name="Tahoma"
RepeatDirection ="horizontal " RepeatColumns=" 3"
Font-Names="Arial"></asp:radiobutton list>
<!--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.Regul ar,
GraphicsUnit.Po int)

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*******@worl dsavings.comwro te in message
news:11******** *************@5 1g2000cwl.googl egroups.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:radiobutto nlist id="rblAuditTyp e" Width="100%" Runat="server"
AutoPostBack="F alse" Font-Size="XX-Small"
Font-Name="Tahoma"
RepeatDirection ="horizontal " RepeatColumns=" 3"
Font-Names="Arial"></asp:radiobutton list>
<!--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
1880
by: Phil Powell | last post by:
<? class ErrorMsgCollection { var $name; var $mandatory; var $emptyErr; var $maxLength; var $maxLengthErr; var $minLength; var $minLenghtErr;
0
1544
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 putenv('GDFONTPATH=c:\windows\fonts'); $bbox=imagettfbbox(10,0,"arial.ttf","Hello World"); echo "upper left ($bbox,$bbox)-----upper right ($bbox,$bbox)<br><br>"; echo "lower left ($bbox,$bbox)-----lower right ($bbox,$bbox)";
0
1515
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, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134))); ..... graphics.DrawString(strtmp,this.Font,this.brushBlack, DrawStringValidRect(ref ,graphics,this.Font ,
4
2655
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 store and retrieve *any* type of object to the ArrayList. However I am getting conversion errors - Can anyone helpe me please?
1
1003
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: Dim var_1 as String = txtName.myText Till here everything works fine. Now I am trying to convert my file to a Code Behind file and here starts my problem. <My:Control ID="txtName" runat="server" /> is in WebForm1.aspx now and Dim var_1 as...
3
5761
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 page. This works ok on it's own but I can't seem to access the actual value of the control or the option value ( <option value="6">...NT...</option>) .. Any ideas ppl?
3
4745
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 user to be able to change them; i.e. want them ReadOnly to the grid. I tried setting that classes property to the ReadOnly attrib, but it wouldn't take it. (Keywork is not valid as an identifier) So how can one have a property value that shows up...
1
1934
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 column to be visible when the "TransactionType" field = "Income" i.e. I want to do something like this for the visible property: IF Eval("TransactionType") = "Income"
4
4595
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 on another form. When the selection changes from the saved data, I wish to show it a different colour. As it is read-only the ForeColor property has no effect.
0
8394
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8306
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8825
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8732
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8503
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8605
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6164
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5632
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4152
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...

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.