Facing null reference exception in base.Dispose when inheriting a class from ToolStrip

Vignesh 0 Reputation points
2024-01-08T07:43:01.8166667+00:00

Facing a null reference exception in base.Dispose when deleting items in the designer while inheriting a class from ToolStrip when DesignMode is true. The exception doesn't occur when DesignMode is false, but the items are not disposed of when deleted through the designer. Please refer to the below screenshots for your reference.

Screenshot 2024-01-08 110423

Exception arising from the "ChangeToolStripParentVerb" class. The exception only occurs the first time I delete it. On following attempts, the exception doesn't occur.Screenshot 2024-01-08 110551

Developer technologies Windows Forms
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.