G
Guest
I'm developing a composite winforms control that derives from System.Windows.Forms.UserControl, and I want it to behave as a singleton so that each form will access the same instance. When I implement the singleton design pattern by making the constructor private, the VS IDE throws an error when I drag the control on to a form
"An error occurred while trying to create an instance of 'NavigationControl'. The exception was "Constructor on type 'NavigationControl' not found.
To solve the problem, I need the IDE to create custom code when my control is dragged on to a form. Instead of "NavigationControl1 = New NavigationControl", I need NavigationControl1 = NavigationControl.CreateInstance
Does anyone know how to override the System.Windows.Forms.UserControl's designer to accomplish this
Thank you!
"An error occurred while trying to create an instance of 'NavigationControl'. The exception was "Constructor on type 'NavigationControl' not found.
To solve the problem, I need the IDE to create custom code when my control is dragged on to a form. Instead of "NavigationControl1 = New NavigationControl", I need NavigationControl1 = NavigationControl.CreateInstance
Does anyone know how to override the System.Windows.Forms.UserControl's designer to accomplish this
Thank you!