Autor Beitrag
D. Annies
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 1843

windows 7
D6 Enterprise, D7 Pers und TD 2006
BeitragVerfasst: Di 03.01.06 13:34 
Hi Delpher,

Wenn ich die Exe ohne Delphi laufen lasse, ist alles in Ordnung, aber zur Laufzeit schmiert mir der Code ab, wenn ich das TempForm (= TBuchBild) einmal vergrößert habe und es wieder verkleinere:

ausblenden volle Höhe Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
procedure tform1.t4click(sender:tobject);                    // Buchtitel ins SG
var dname    : string;                                       // und Bild anzeigen
begin
  edit8.text := QBuchstamm.fieldbyname('TITEL').asstring;
  dname := concat(home, '\''Bildb\',QBuchstamm.fieldbyname('TITEL').asstring,'.jpg');
  if fileExists(dname) then
  begin
    TBuchBild := TForm.Create(Self);  TBuchBild.setbounds(10,325,290,400);
    TBuchBild.BorderIcons := bordericons -[biminimize, bimaximize];
    TBuchBild.Show;
    image2.Parent := TBuchBild; image2.picture.loadfromfile(dname);
    TBuchBild.Caption := extractfilename(dname);
    image2.setbounds(10,10,260,350); image2.Visible := true;
    image2.Hint := 'Vergr÷¯ern mit <Klick>';
  end
  else
    showmessage(QBuchstamm.fieldbyname('TITEL').asstring+' ist noch nicht digitalisiert ..');
end;

procedure TForm1.img2_onclick(sender:tobject);
begin
  if image2.Width = 520 then
  begin
    TBuchBild.setbounds(10,325,290,400); image2.setbounds(10,10,260,350);
    image2.Hint := 'Vergr÷¯ern mit <Klick>';
  end
  else
  if image2.Width = 260 then
  begin
    TBuchBild.setbounds(5,5,560,730); image2.setbounds(10,10,520,680);
    image2.Hint := 'Verkleinern mit <Klick>';
  end;
end;


Was mache ich da noch falsch?

Danke für Hilfe,
Detlef A.
AXMD
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 4006
Erhaltene Danke: 7

Windows 10 64 bit
C# (Visual Studio 2019 Express)
BeitragVerfasst: Di 03.01.06 13:49 
Zeile 8: Du erzeugst eine Form, die du nicht wieder freigibst... ist das Absicht? Außerdem solltest du Forms normalerweise per Application.CreateForm erzeugen...

AXMD
D. Annies Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 1843

windows 7
D6 Enterprise, D7 Pers und TD 2006
BeitragVerfasst: Di 03.01.06 15:00 
Danke für den Hinweis, Andreas,

ich hatte .free auch schon versucht, aber ohne Verbeserung - also gehe ich jetzt mal an Application.CreateForm. - Das muss ich aber auf jeden Fall freigeben? (??)

Bis dann,
Detlef A.
D. Annies Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 1843

windows 7
D6 Enterprise, D7 Pers und TD 2006
BeitragVerfasst: Di 03.01.06 18:04 
Hi Andreas (et aliter),

nun, ich habe damit keine Verbesserung erreicht, - jetzt stürzt das Prg beim ersten Aufruf des TempFormulars ab, um genau zu sein ...

Bis bald,
Detlef A.
D. Annies Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 1843

windows 7
D6 Enterprise, D7 Pers und TD 2006
BeitragVerfasst: Mi 04.01.06 18:40 
Hi Delpher,

noch etwas ist mir aufgefallen:

Nachdem ich einmal vergrößert habe und wieder verkleinere (man sieht ja nur den Schließen-Button, siehe BorderIcons) ist es nur noch ein schwarzes Kreuz und nicht mehr rot.

Also - weiter bin ich noch nicht gekommen. Habe ich die Parent-Eigenschaft falsch gesetzt?

Danke für Hilfe,
Detlef