microsoft/winforms-designer-extensibility

Custom public properties on a Form type do not show in PropertyGrid of designer

pallibj opened this issue · 1 comments

Steps to reproduce:

  1. Create a new form and add a simple public property on it, say "public string Test {get; set;}"
  2. Rebuild and open form in designer.
  3. The new property is not shown in the PropertyGrid.

Now, repeat the same with a UserControl:

  1. Create new UserControl and add the same simple property Test.
  2. Create new Form and drop the new UserControl on the form.
  3. Rebuild and open form in designer.
  4. The new property is now shown in the PropertyGrid for the UserControl.

Palli

Well, in the first case, the Form is only being built at the moment, so what you see on the screen at design time, is the base class of that Form, and that of course does not have the property at that point.

In contrast, if you have built a UserControl, and use it in a Form, then the UserControl has been built. And therefore, it has the property.

This is By Design, and it is exactly how the classic Framework Designer also works.