Property Accessing other properties

 hello i am new to 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
9/23/2008 3:04:37 PM
📃 91979 articles.

💬 1 Replies

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.

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.
9/26/2008 6:16:45 AM