Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Class compilation problem
Message
From
13/09/2007 20:08:42
Alan Harris-Reid
Baseline Data Services
Devon, United Kingdom
 
 
To
All
General information
Forum:
ASP.NET
Category:
Class design
Title:
Class compilation problem
Miscellaneous
Thread ID:
01254256
Message ID:
01254256
Views:
58
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
Next
Reply
Map
View

Click here to load this message in the networking platform