C# handling properties

Electronics Computer Programming Q&A
Post Reply
User avatar
atferrari
Posts: 24
Joined: Sat Nov 22, 2008 11:02 pm
Location: Buenos Aires - Argentina
Contact:

C# handling properties

Post by atferrari » Fri Dec 19, 2008 1:19 am

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

User avatar
reloadron
Posts: 519
Joined: Sat Jun 28, 2008 8:57 am
Location: Cleveland, Ohio
Contact:

Post by reloadron » Fri Dec 26, 2008 4:54 pm

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

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests