views:

24

answers:

1

Hi,

Does setting PropertyGrid.SelectedObject = null; effects the actual object? eg:

Button b = new Button();
System.Windows.Forms.PropertyGrid pg = new System.Windows.Forms.PropertyGrid();
pg.SelectedObject = b;

pg.SelectedObject = null;

What will happen to Button b? will it be null?

Thanks & regards, Vishal.

+2  A: 

Setting PropertyGrid.SelectedObject only affects the PropertyGrid. If you set SelectedObject to null, it means that there is simply no object displayed in the property grid. In your example, button b will not be affected.

msergeant