I have a problem with (I suppose) my Visual Studio 2010 Express environment: when I create my own UserControl, in the Properties grid, I donβt see the public properties of this control. They are, however, visible in the project, citing this control.
Since this is an Express Edition, I create a new empty project and then add a new UserControl to it.
Then for the test I will put the following code:
using System; using System.Collections.Generic; using System.ComponentModel; using System.Drawing; using System.Data; using System.Linq; using System.Text; using System.Windows.Forms; namespace Project1 { public partial class UserControl1 : UserControl { private int myNumber; [Browsable(true)] public int MyNumber { get { return myNumber; } set { myNumber = value; } } public UserControl1() { InitializeComponent(); } } }
In VS 2008, as I recall, it must be enogh to show the MyNumber property in the property grid even without the [Browsable(true)] attribute. In VS 2010, however, when I double-click UserControl1.cs in Solution Explorer and look in the properties, I do not see MyNumber.
When I reference and use this control in another project, I have access to its properties.
I tried reinstalling the VS 2010 environment, including SP1, but without success. You do not know what could be wrong?
By the way, none of these attributes work:
[Browsable(true)] [EditorBrowsable(EditorBrowsableState.Always)] [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)] [Bindable(true)]
Yours faithfully,
Marcin
source share