Live Chat Icon For mobile
Live Chat Icon

How do I provide Intellisense support to my controls while coding against them and also provide Description support for the properties in the property grid?

Platform: WinForms| Category: Tips

You can provide Intellisense support to your type and it’s members by providing xml comments in code as follows:

/// <summary>
/// Summary description for Form3.
/// </summary>
public class Form3 : System.Windows.Forms.Form
{
    /// <summary>
    /// Clean up any resources being used.
    /// </summary>
    protected override void Dispose( bool disposing )
    {
    }
    /// <summary>
    /// Summary of my property
    /// </summary>
    public bool MyProperty
    {
        get{..}
        set{..}
    }       
}

Search for the ‘Tags for Documentation Comments’ topic in MSDN for all the available documentation tags.

Then in your project, go to the Project Properties dialog, to the Configuration Properties/Build tab and specify a file for the XML Documentation File property. This will generate a file by that name when you compile your assembly. Place this xml file beside your dll. This will provide Intellisense support for your types in that assembly.

To provide Description support for your properties in the property grid in the designer, add the DescriptionAttribute attribute to your properties in code.

///
/// Summary of my property
/// 
[Description('description of the property')]
public bool MyProperty
{
    get{..}
    set{..}
}

Share with

Share on twitter
Share on facebook
Share on linkedin

Related FAQs

Couldn't find the FAQs you're looking for?

Please submit your question and answer.