How to Detect whether a Property Value is Changed in the Property Editor?

16 Dec 20241 minute to read

You can use the PropertyValueChanged event to detect whether a property value is changed in the property editor. The following code example illustrates this.

//PropertyValueChanged event.

propertyEditor1.PropertyGrid.PropertyValueChanged += new PropertyValueChangedEventHandler(PropertyGrid_PropertyValueChanged);

private void PropertyGrid_PropertyValueChanged(object s, PropertyValueChangedEventArgs e)

{            

     //Here, capture the changed property (e.ChangedItem) and process the same.

}
'PropertyValueChanged event.

AddHandler propertyEditor1.PropertyGrid.PropertyValueChanged, AddressOf PropertyGrid_PropertyValueChanged

Private Sub PropertyGrid_PropertyValueChanged(ByVal s As Object, ByVal e As PropertyValueChangedEventArgs)

'Here, capture the changed property (e.ChangedItem) and process the same.

End Sub