views:

24

answers:

2

Hi to all,

I've written a windows form control library. I've used it at my main desktop (form) application. But I can not see the properties I have added my control library !

The way to add property to a user_created component is possible with working on class view. But I can not make my properties shown in properties windows like other default controls (e.g Button)

Is there any solution for this?

Thanks.

A: 

is the new property public?

najmeddine
see my last comment above. you'll get the answer
Cmptrb
+1  A: 

Any public property should appear in the propety designer, e.g.

    /// <summary>
    /// Number Format
    /// </summary>
    [Category("Formatting"), DefaultValue("#,##0"), Description("Formatting string for numbers")]
    public string NumberFormat { get; set; }

The attributes set how it is displayed in the property grid and are all part of the System.ComponentModel namespace

JDunkerley
@najmeddine : it is not important if the property public or not [if I'm wrong please correct]@ JDunkerley : I thank you lot, it works!
Cmptrb
I tested that, it does not work with private or protected properties (C# .NET 2.0). If you succeeded, can you tell me how to do that?
najmeddine
I'd tested it too, you're right private or protected properties (.net 2.0 or 3.5) are not shown. Thanks for test. My property was public.
Cmptrb