tags:

views:

150

answers:

3

Hi,

I'm creating a custom WinForms TextBox control, like this:

class MyTest : TextBox
{
    protected override void OnEnter(EventArgs e)
    {
        this.BackColor = Color.Yellow;
    }
    protected override void OnLeave(EventArgs e)
    {
        this.BackColor = Color.White;
    }
}

When I build the project, I cannot see the control. Can anyone explain why not?

Thanks in advance.

A: 

you should add the control inside a project and place it on a form. Just a usercontrol by itself you will not see when you build the project.

Tony
how to do it ??
Gold
check this link. http://msdn.microsoft.com/en-us/library/9yxtkx75%28VS.80%29.aspx
Adeel
A: 

The control should automatically be displayed and will show up under a tab with the project name. You have to be within a designer view other than your control. If that doesn't work you can right click on the toolbox and click Reset Toolbox. Make sure you are rebuilding the entire solution.

Icono123
A: 

You have to make the project containing the custom TextBox a class library. If you however decide to keep it as a single UserControl file in the current project, you'll have to reference the control manually.

Alex Essilfie