We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

CollectionBase question

Hi I have my Collection class inherited from CollectionBase. Now, by default the VS.Net IDE will provide a Collection Editor for any properties of type of my Collection. I am adding components of type MyComponent(inherited from Component) to the collection. I have overriden the Dispose method of Component in MyComponent class. When the user clicks the Remove button in the collectionEditor and then Ok, the Dispose method is called. Now i want that when a component is removed the user should be prompted for confirmation via a MessageBox.Show, and only if he clicks OK in the MessageBox should the component be removed. I know i can examine the DialogResult property of the MessageBox.Show() method, but what code should be written when Cancel is clicked so that the component remains in the collection. Thanks in advance Best Regards Vikas

Loader.
Live Chat Icon For mobile
Up arrow icon