Originariamente inviato da gibra
Non vedo problemi.

A me funziona in entrambi i modi:

1)
Me.GroupBox1.Controls.Add(Button1)

2)
Me.Controls.Add(Button1)
Button1.Parent = GroupBox1


Forse l'errore è dovuto ad altro...

si probabile ma lo fai caricando la dll come plugin ?

EDIT:

c'è cmq qualcosa di strano
perchè se provo per esempio a modificare il testo di TextBox1 dalla DLL (TextBox1 si trova nel programma principale)

facendo
codice:
Public Sub Start(ByVal MyForm As Object) Implements [Interface].Extension.Start

        
      
        MyForm.TextBox1.Text = "Prova"


    End Sub
appena carico la dll

ricevo l'errore che allego:

codice:
************** Testo dell'eccezione **************
System.MissingMemberException: Impossibile trovare il membro pubblico 'TextBox1' nel tipo 'Form1'.
   in Microsoft.VisualBasic.CompilerServices.Symbols.Container.GetMembers(String& MemberName, Boolean ReportErrors)
   in Microsoft.VisualBasic.CompilerServices.NewLateBinding.LateSet(Object Instance, Type Type, String MemberName, Object[] Arguments, String[] ArgumentNames, Type[] TypeArguments, Boolean OptimisticSet, Boolean RValueBase, CallType CallType)
   in Microsoft.VisualBasic.CompilerServices.NewLateBinding.LateSet(Object Instance, Type Type, String MemberName, Object[] Arguments, String[] ArgumentNames, Type[] TypeArguments)
   in WiFi.WiFi.Execute(Object MyForm)
   in Prg.Form1.PluginFinder(String Command)
   in Prg.Form1.Form1_Load(Object sender, EventArgs e)
   in System.EventHandler.Invoke(Object sender, EventArgs e)
   in System.Windows.Forms.Form.OnLoad(EventArgs e)
   in System.Windows.Forms.Form.OnCreateControl()
   in System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
   in System.Windows.Forms.Control.CreateControl()
   in System.Windows.Forms.Control.WmShowWindow(Message& m)
   in System.Windows.Forms.Control.WndProc(Message& m)
   in System.Windows.Forms.ScrollableControl.WndProc(Message& m)
   in System.Windows.Forms.ContainerControl.WndProc(Message& m)
   in System.Windows.Forms.Form.WmShowWindow(Message& m)
   in System.Windows.Forms.Form.WndProc(Message& m)
   in Prg.Form1.WndProc(Message& m)
   in System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   in System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   in System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)