Creating a Textbox in VS with Object Automation
I have used the sample in Microsoft Visual Studio .NET Automation Sample: Windows Forms Automation Add-in : http://msdn.microsoft.com/vstudio/downloads/samples/automation.asp
just to create an add-in to produce a project with one specific winform, where you can create any controls.
I can create Button or Label controls, just using:
Dim host As IDesignerHost
host = CType(applicationObject.ActiveWindow.Object, IDesignerHost)
....
Dim control1 As IComponent
control1 = host.CreateComponent(host.GetType("System.Windows.Forms.Label,System.Windows.Forms"))
....
But If I try to create in the same way a textbox control using the corresponding Type:
Dim control2 As IComponent
control2 = host.CreateComponent(host.GetType("System.Windows.Forms.Textbox,System.Windows.Forms"))
....
the error Object reference is the exception produced.
Do you know where is my error?
Thanks in advance

