I have a custom control MyControl
. Has a parameterless constructor (Sub New()
in VB).
I place that control in a WinForm.
No problems.
Now, want a parameter in that constructor. Sub New(flag as Boolean)
How should I deal with VS designer in that case, in order to be able to open that form in Designer?
I did in myForm the following
Public Sub New()
MyBase.New()
Me.MyControl_1 = New MyControl(True)
Me.InitializeComponent()
but the Designer says:
The variable 'MyControl_1' is either undeclared or was never assigned.