Tag: C#

Prevent raising of Validating event of focused control when Closing the form

When you have an event handler for Validating event of a control, if the value of AutoValidate property of the form is set to anything different from Disabled, then Validating event will fire when you try to close…

Read More »

Make a Property Read-Only in PropertyGrid

Sometimes you want to make a property read-only in PropertyGrid based on some criteria at run-time. For example, let’s suppose you have a SampleClass containing two properties, Editable and StringProperty and you want to make StringProperty read-only if…

Read More »