Sprache: C#
Hallo,
Ich habe mir mal einen Kleinen Code gebastelt womit ich ein MDI-Child auf einen zweiten Monitor aus dem Parent herausziehen konnte.
PS.: ich bin noch kein Profi und habe mir alles selbst angeeignet vlt kann einer der PROFIS ja mal seine Meinung sagen oder Tipps zur Verbesserung geben.!!!!
[b][u]Im Haubtformular[/u][/b]
[code]
privat void main(){
// >>> Hier steht der Main Code
}
// Der Zwischenspeicher MUSS DIREKT NACH MAIN STEHEN
public static object psave_MDIChild { get; Internal set;}
// Öffnen des MDI Childs in einer Unterfunktion
Form ichbindas_Kind = new Form();
ichbindas_kind.parent = this;
psave_MDIChild = this;
ichbindas_kind.Show();
[/code]
Im Untreformular wurde dann dieser Code beim On Klick auf einen Dropdown in der Statusbar dann ausgeführt
[b]Zum Entkoppeln[/b]
[code]
this.parent = null;
[/code]
[b]Zum erneuten Koppeln[/b]
[code]this.parent = Parent.psave_MDIChild;[/code]
Und der Komplette Code nochmal
privat void main(){
// >>> Hier steht der Main Code
}
// Der Zwischenspeicher MUSS DIREKT NACH MAIN STEHEN
public static object psave_MDIChild { get; Internal set;}
// Öffnen des MDI Childs in einer Unterfunktion
Form ichbindas_Kind = new Form();
ichbindas_kind.parent = this;
psave_MDIChild = this;
ichbindas_kind.Show();
------------------------------------------------
// Im unter formular
// Entkoppeln mit
this.parent = null;
// erneut Koppeln mit
this.parent = Parent.psave_MDIChild;
privat void main(){
// >>> Hier steht der Main Code
}
// Der Zwischenspeicher MUSS DIREKT NACH MAIN STEHEN
public static object psave_MDIChild { get; Internal set;}
// Öffnen des MDI Childs in einer Unterfunktion
Form ichbindas_Kind = new Form();
ichbindas_kind.parent = this;
psave_MDIChild = this;
ichbindas_kind.Show();
------------------------------------------------
// Im unter formular
// Entkoppeln mit
this.parent = null;
// erneut Koppeln mit
this.parent = Parent.psave_MDIChild;
Alte URL:
/snippet/mdichild-aus-parent-entkoppeln-und-erneut-koppeln/15145