Einzelnen Beitrag anzeigen

Benutzerbild von tomsel
tomsel

Registriert seit: 8. Dez 2005
Ort: am Chiemsee
304 Beiträge
 
Delphi 7 Professional
 
#8

Re: create form wiederfinden problem

  Alt 10. Jan 2006, 21:42
würde nicht auch dieses gehen:

Delphi-Quellcode:
function tform1.openwindow(id: string):string;
var
  myForm: TForm2;
begin
  if listbox1.Objects[listbox1.itemindex] = nil then begin

    myForm:= TForm2.Create(application);
    myForm.Show;
    myform.Caption := listbox1.items[listbox1.itemindex];

    listbox1.Objects[listbox1.itemindex] := tobject(myform); // <------------------------!!

    myform.Memo1.Lines.Add('hallo'+listbox1.items[listbox1.itemindex]);

  end else begin

    myform := tform2(listbox1.Objects[listbox1.itemindex]);
    myform.bringtofront;

  end;

end;
Ein Experte ist ein Mann, der hinterher genau sagen kann, warum seine Prognose nicht gestimmt hat. (Winston Churchill)
  Mit Zitat antworten Zitat