Vishal
Vishal

Reputation: 215

Windows forms: PropertyGrid

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.

Upvotes: 0

Views: 545

Answers (1)

msergeant
msergeant

Reputation: 4801

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.

Upvotes: 3

Related Questions