show properties of a control in property window

T

Thanh-Nhan Le

Hi,
I am writing a control myTextbox (simply a new class, which inherits class TextBox).
myTextbox class has property DataControlTyp, which is a enumeration: Now when I select this control in design window, I want to see this property as a list (combobox) in property window, to set a value to it.

How can I do it? Following is my code.

Thanks
Nhan
public enum enumDataControlTyp : short

{

DataControlTyp_Yes = -1,

DataControlTyp_None = 0,

DataControlTyp_Yes_xxx = 1

}

public class myTextbox : System.Windows.Forms.TextBox

{

protected enumDataControlTyp m_tDataControlTyp = enumDataControlTyp.DataControlTyp_Yes_xxx;

public enumDataControlTyp DataControlTyp

{
get { return m_tDataControlTyp; }

set { m_tDataControlTyp = value; }
}

}
 
M

Marc Gravell

That should be all you have to do. Try reloading VS if it isn't
appearing...

Marc
 
T

Thanh-Nhan Le

No, I cannot see it. I have also property DataField in the class, it appears
in the prop window. The prop DataControlTyp is not to see.

public string DataField

{
get { return m_sDataField; }
set { m_sDataField = value; }

}
 
T

Thanh-Nhan Le

OK, now I have it.
My myTextbox inherrits from a abstract class, which inherits form the class
Textbox.
It can be, that I must restart my computer :) ?

But now I can see it. Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top