Property Accessing other properties

 hello i am new to asp.net and also c# and trying to learn some basic concepts now. I am reading article about the font property

I am a little confused here. My question is 

Font property belong to WebControl class 

Font properties belong to FontUnit Class. 

How does the Font property access the font properties in the FontUnit Class

Please if somebody could clarify this point for me

thanx

0
hassu
9/23/2008 3:04:37 PM
asp.net.getting-started 91979 articles. 4 followers. Follow

1 Replies
890 Views

Similar Articles

[PageSpeed] 31
Get it on Google Play
Get it on Apple App Store

Hi,

As far as I can see, FontUnit represents the size of a font.

So please look the following code.

        Button bt = new Button(); // we create  a WebControl
        bt.Font.Size = FontUnit.Large;

The return type of "bt.Font.Size" is "FontUnit", so we need to put a value which the type is FontUnit.

The construct of bt.Font.Size like the following.

public FontUnit Size { get; set; }

The connection between FontUnit and Font.Size is create by the above code.
 

In addition, I suggest to full use the function of the VisualStudio, we could move the mouse point on the code "Size" and right click. Please select the item "Go to Definition" in the popup menu, then you could see the struct of the class,property and so on.

 

 

I look forward to receiving your test results.

 


Sincerely,
Zong-Qing Li
Microsoft Online Community Support
Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as
Answer” if a marked post does not actually answer your question.
0
Zong
9/26/2008 6:16:45 AM
Reply:

Similar Artilces:

Custom property editor accessing other component properties
I have a component which has a custom property editor for one of its properties. The custom property editor is derived from TStringProperty and works as expected. I need to, however, modify the editor to show a number of user selectable items which depends on the value of another property in the same component. How do you design a property editor for a component that can reference other properties of the component besides the one that it is designed to edit? I am using BCB6. Regards FarmerJo John wrote: > I have a component which has a custom property editor for one of its &...

getting a property value when expression is used on property
Hi everyone, I'm using PB10.2.0.8011 on Windows XP. I hate asking fundamental questions for which I know the answer lies in a manual, but I am having a rough time finding the answer to my question. I initially created a computed column with expression: describe("day1.x"), which refers to a dw object's property which in itself has an expression defining the value. The result is as expected a value of the form value~texpression. So, I tried the following column expression to extract the actual value of x: describe("evaluate('day1.x'," + ...

Property access must assign to the property or use its value.
I have a very basic function in my data access layer, which seems as though it is structured the same as my other functions, however it raises an error I've never seen, and I'm not sure what it means. The message reads "Property access must assign to the property or use its value."My code is as follows: Public Shared Function GetFirstPage(ByVal ParenGroupID As Int32) As SqlDataReaderDim myConn As SqlConnection = New SqlConnection(ConfigurationSettings.AppSettings("ConnectionString"))Dim cmd As SqlCommand = New SqlCommand("MGMT_GetFrontPostPage", myConn)cmd.CommandType = CommandType.StoredPr...

Objects and properties of properties
Okay, this should be an easy object oriented C# question, but for some reason I have been unable to find the answer yet. I am creating an object of my own called JAddress. And basically I want to be able to do the following: JAddress.ZipCode.Text JAddress.ZipCode.MyId I am unsure on how to create the second level of properties! Doing only a first level is really easy.....public string ZipCode { get { return m_ZipCode; } set { m_ZipCode = value; } }Does anyone know how to do this? Thanks in advance, csdietrich You would have its own ZipCode type (class) which...

Property access must assign to the property or use its value
 Hi, I when I tried to build my solution in vs2003 I get the following error message. "Property access must assign to the property or use its value." The following is my code to help you better understand my situation. Imports System.IO Imports System.Data.Odbc Public Class Upload     Inherits System.Web.UI.Page  Private Sub Submit1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Submit1.Click         Dim strFileExtension As String         Dim...

Custom property editor that can access other properties of a component.
I have a component that has a custom property editor for one of its properties. The editor provides a drop-down list of items that the user can select, this works as expected. I would like to modify the editor so that the list of items in the drop-down list depends also on the value of another property in the same component. How do I design a custom property editor that can access a property of a component other than the property for which the editor is registered? Regards FarmerJo John wrote: > How do I design a custom property editor that can access a property > of a compo...

Error: Property access must assign to the property or use its value.
Hello, I am having a problem and I am not sure what I am doing wrong with my property: Private ReadOnly Property returnUsername() As String Get If Page.IsPostBack() = True Then returnUsername = ToString(usernametxt.Text)Return returnUsername Else returnUsername = ""Return returnUsername End If End Get End Property  I getting the error: Property Access must assign to the property or use its value.  I thought I was already doing that. Any help will be greatly appreciated. Thanks  I think you cannot use page.ispostback() from the property(i think...

How to get the properties box to display properties while in source view mode?
The book shows that it's like automatically done and assumed that my VWD is set up to do this. I have never seen this working, can't figure out how to get the properties window to display properties via the pages source view. I have always seen it via details view.How can I enable this feature?   http://weblogs.asp.net/scottgu/archive/2006/12/19/html-source-editing-performance-improvements-in-vs-2005-sp1.aspx Remember to check "Show all settings" Regards,PrashantDont forget to click "Mark as Answer" on the post that helped you. Thank you so...

BC30545: Property access must assign to the property or use its value.
Hi, I'm new to ASP.NET, and I've been going through the Webcasts that Bill Steel made - the 26 part series. Anyway, I'm on creating my first app, a calculator page, supposedly simple.  I came across the following error when testing the page, and I followed the video, verbatim, and still can't get my page to come up. BC30545: Property access must assign to the property or use its value.Here's the code in my Calc.aspx page: ========BEGIN CODE calc.aspx================ <% page language="VB" CodeFile="Calc.aspx.vb" Inherits="Calc_aspx" %> <html>  <head><ti...

Error: Property access must assign to the property or use its value.
 I am working on a project and I need to set the default values to load in the text boxes. When I insert the default values it displays the error message Normal 0 false false false EN-US X-NONE X-NONE MicrosoftInternetExplorer4 ...

Property access must assign to the property or use its value. #2
 Hi all.I am attempting to pass a parameter (called id) contained within the URL from one page to another using <% request.querystring("id") %>, however, when i do this i am presented with the following error message.'Property access must assign to the property or use its value.' The URL is as follows http://www.mywebsite.co.uk/spareparts/admin/edit-part.aspx?id=12 And i am using the following code to try and access and use this value <a href="change-part-type.aspx?id=<% request.querystring("id") %>"> LINK TO OT...

How to get file/directory access properties ?
Hi How can I check that some file/directory can read/write from my asp.net application? One easy way is just trying to read/write those files and directories, if you get some exception, the exception message will tell you detailed information. try{    // do you read , write here. }catch(Exception ex){    //check ex.message here. } J.W.Please click "Mark as Answer" on this post if it helps you. Hi vitalka, Have you check the DirectorySecurity Class? The DirectorySecurity class specifies the access rights for a system direct...

HELP! BC30545: Property access must assign to the property or use its value
Hi,   Im using a 4guysfromrolla sample to bind sqldatasource results to a label.  However Im getting the above error.  Here is my code:-----------------------------------------------------------------------------------------------------------------------------------Imports System.Data Partial Class datareaderInherits System.Web.UI.Page Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.LoadDim dv As DataView = CType(SqlDataSource1.Select(DataSourceSelectArguments.Empty), DataView) Dim rndCoinFlip As New RandomRandomProductNames.Text = St...

User Control Property Persistence
I have a user control that's rendered in a data bound List View, for example:<asp:ListView ID="ListBuildings" DataSourceId="ListDataSource" runat="server"><ItemTemplate>    <custom:Rater ID="Rater" BuildingId='<%# Eval("BuildingId")%>' runat="server" /></ItemTemplate></asp:ListView> I set a custom property on my user control called BuildingId, but on post backs I'm not finding the BuildingId property set to what I set it to in the through the list view's databind...

Web resources about - Property Accessing other properties - asp.net.getting-started

Properties of water - Wikipedia, the free encyclopedia
This article is about the physical and chemical properties of pure water. For general discussion and its distribution and importance in life, ...

Facebook Surpasses All Google Properties In Brazil
Facebook overtook Orkut to became Brazil’s top social network in January, but has only overtaken all of Google’s properties in that nation just ...

Extended Profile Properties - Facebook-Entwickler
These Permissions cannot be revoked in the Login Dialog during the login flow, meaning they are non-optional for Users when logging into your ...

PortPerry Properties (@brian14mckinlay) on Twitter
Sign in Sign up To bring you Twitter, we and our partners use cookies on our and other websites. Cookies help personalize Twitter content, tailor ...

Hawaii Real Estate Properties on the App Store on iTunes
Get Hawaii Real Estate Properties on the App Store. See screenshots and ratings, and read customer reviews.

Australian Federal Police raid properties in new CFMEU-linked investigation
Federal Police have raided properties as part of an investigation into a CFMEU organiser suspected by authorities of being bribed.

Nobody's home: Housing boom leaves swathe of empty properties
The nation's three-year property boom is leaving its biggest cities awash with empty homes, a report shows.

WA fires: Blaze damage grows to 162 properties in South West
... the deadly bushfires in Western Australia's South West region have climbed to 162 homes. The updated assessment is an increase of 34 properties ...

Digital detox: Australians seek out nature properties to overcome technology burnout
Holiday home rental companies say they have seen a spike in the number of customers seeking digital detoxes, allowing savvy homeowners to offer ...

These are the 9 Airbnb properties where everybody dreams of staying
Airbnb has become popular partly because people can open up their exquisite (or strange) properties around the world. When Airbnb looked at ...

Resources last updated: 1/20/2016 7:24:37 AM