Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Class compilation problem
Message
De
13/09/2007 20:08:42
Alan Harris-Reid
Baseline Data Services
Devon, Royaume Uni
 
 
À
Tous
Information générale
Forum:
ASP.NET
Catégorie:
Conception classe
Titre:
Class compilation problem
Divers
Thread ID:
01254256
Message ID:
01254256
Vues:
59
Hi all,

I am creating a base-textbox class using Kevin Goff's suggested code below.
using System;
using System.Drawing;
using System.Windows.Forms;

namespace BaseControls
{
   public class BaseTextBox : TextBox
   {
     public override Font Font
      {
        get { return base.Font; }
	set {base.Font = value; }      // new line
	}

	public BaseTextBox()
	{
	base.Font = new  Font("Tahoma",8);
        }
   }
}
My problem is that the code will not compile correctly under Visual C# (Express). The first 'Font' above is underlined and I get the error message "The type or namespace 'Font' could not be found (are you missing a using directive or an assembly reference?)"

Any ideas on this one? Any help would be appreciated.

Alan
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform