Forum: GUI-Design mit VCL / FireMonkey / Common Controls
Delphi
by tomsel,
10. Jan 2006
würde nicht auch dieses gehen:
function tform1.openwindow(id: string):string;
var
myForm: TForm2;
begin
if listbox1.Objects = nil then begin
myForm:= TForm2.Create(application);
myForm.Show;
Forum: GUI-Design mit VCL / FireMonkey / Common Controls
Delphi
by tomsel,
10. Jan 2006
@gg
So viele Buchstabendreher auf einem Haufen hab ich ja selbst noch nicht hingekriegt :mrgreen:
Was ist los? Zu tief in's Glas geguckt?
Forum: GUI-Design mit VCL / FireMonkey / Common Controls
Delphi
by tomsel,
10. Jan 2006
Ja, oder auch so.
Aber da er die Forms mit Application als Owner instantiiert, hat er diese Liste ja bereits zur Verfügung mit Application.Components.
Forum: GUI-Design mit VCL / FireMonkey / Common Controls
Delphi
by tomsel,
10. Jan 2006
kannste damit was anfangen:
function TForm1.SucheCaption(aCaption:string):tform;
var i:integer;
begin
result := nil;
for i:=0 to pred(application.Componentcount) do
if application.Components is tform2 then
if tform(application.Components).Caption = aCaption then
result := tform(application.Components)
Forum: GUI-Design mit VCL / FireMonkey / Common Controls
Delphi
by tomsel,
10. Jan 2006
form2.Caption := 'Die Caption, die ich haben will';
Initialisiere alle deine form1, form2, .., formX - Variablen zu Beginn mit NIL.
Wenn eines der Forms wieder freigegeben wurde, setze die entsprechende Variable ebenfalls wieder auf NIL.
Dann hast du immer die Kontrolle über die erzeugten und nicht erzeugten Forms, indem du die Variablen auf NIL überprüfst. Beispiel: