how to use the 'description' attribute in c#

  • Thread starter Thread starter KPK
  • Start date Start date
K

KPK

Hello:

What namespace do I need to import in order to use the description
attribute in c#? I have class with custom properties and I would like
to have a description of the properties displayed on the property
page.

Here is the format I'm using:

[Description("User's Name")]
public string Name
{
get
{
return m_strName;
}
set
{
m_strName = value;
}
}

all it tells me is that type of namespace name cannot be found.

thanks.
 
KPK said:
What namespace do I need to import in order to use the description
attribute in c#?

System.ComponentModel.

The way to find this out in future is to look for the class name in
MSDN (DescriptionAttribute in this case) - that tells you the full name
of the class.
 
Back
Top