Page 1 of 1

C# handling properties

Posted: Fri Dec 19, 2008 1:19 am
by atferrari
C# language

I understand the basics of handling properties from classes declared by yourself using {get, set}.

I would like to know how to handle properties of classes already declared by C#, i.e. System.Console.Foreground.

Could anyone help with an example or two?

Gracias

Posted: Fri Dec 26, 2008 4:54 pm
by reloadron
Using System.Console.Foreground do you mean like this:

Code: Select all

using System;

public class Test{
   static void Main(string[] args){
      Console.Title = "Standard Console";
      Console.ForegroundColor = ConsoleColor.Red;
      Console.BackgroundColor = ConsoleColor.Green;
      Console.WriteLine("Press Enter to change the Console's appearance.");
      Console.ReadLine();
  }
}
I am not a programmer and what little I do I generally do in VB.

Ron