C-sharp Control auf andere Form übertragen
Hallo liebe Administratoren,
ich habe auf der Form1 eine TextBox, die ich auf Form2 übertragen möchte.
An sich funktioniert es, aber jetzt ist die TextBox auf der Form1 weg. Wie kann ich es machen, dass die TextBox übertragen wird?
ich habe auf der Form1 eine TextBox, die ich auf Form2 übertragen möchte.
var box = this.panel1.Controls as TextBox;
form2.Controls.Add(box);
An sich funktioniert es, aber jetzt ist die TextBox auf der Form1 weg. Wie kann ich es machen, dass die TextBox übertragen wird?
Please also mark the comments that contributed to the solution of the article
Content-Key: 334540
Url: https://administrator.de/contentid/334540
Printed on: April 25, 2024 at 22:04 o'clock
1 Comment
Clone() ist dein Freund!
http://stackoverflow.com/questions/10266589/clone-controls-c-sharp-winf ...
hauruck
http://stackoverflow.com/questions/10266589/clone-controls-c-sharp-winf ...
hauruck