Hi All
I selected Class Library option in C# Vis Studio Express to create a DLL which holds heaps of my commonly-used methods etc...
I'm trying to create a textbox in the class file, so that when I add the dll to another project all i have to type is:
MyControls.Create(TextBox);
...And it will create a text box and return it to me and then i can add it to the form.
I know how to create classes etc, so , my quesiton is... Why can't I use System.Windows.Forms is a class file? I have the following in my Class1.cs file:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace MyControls
{
public class class1
{
public object Create(object control)
{
System.Windows.Forms.TextBox t = new System.Windows.Forms.TextBox();
// textbox properties go here etc...
return control;
}
}
}
BUT the red squigly lines keep telling me that "The type of namespace 'Windows' does not exist in the namespace 'System' (Are you missing an assembly reference)?"
Have I forgotten to add something here...??
Thank you :)