Autor Beitrag
anno2007
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 68

Win 7, Ubuntu
Delphi XE
BeitragVerfasst: Di 04.01.11 16:17 
Hey,
ich hab hier einen Code:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
procedure TForm2.HttpWork(ASender: TObject; AWorkMode: TWorkMode; AWorkCount: Int64);
var
  Http: TIdHTTP;
  ContentLength: Int64;
  Percent: Integer;
begin
  Http := TIdHTTP(ASender);
  ContentLength := Http.Response.ContentLength;

  if (Pos('chunked', LowerCase(Http.Response.TransferEncoding)) = 0and
     (ContentLength > 0then
  begin
    Percent := 100*AWorkCount div ContentLength;

    Image1.Width := round((245/100)*(50+0.5*Percent));            // funktioniert nicht
    Memo1.Lines.Add(IntToStr(round((245/100)*(50+0.5*Percent)))); // funktioniert
  end;
end;


Den hab ich von hier:
stackoverflow.com/qu...ss-event-using-delph

Weis jemand warum sich Image1.Width in der Funktion nicht aktualisieren lässt?

Danke,
anno2007
elundril
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 3747
Erhaltene Danke: 123

Windows Vista, Ubuntu
Delphi 7 PE "Codename: Aurora", Eclipse Ganymede
BeitragVerfasst: Di 04.01.11 17:07 
Gibts ne fehlermeldung o.ä, oder siehst du einfach nicht das sich was tut?

Lg elundril

_________________
This Signature-Space is intentionally left blank.
Bei Beschwerden, bitte den Beschwerdebutton (gekennzeichnet mit PN) verwenden.
anno2007 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 68

Win 7, Ubuntu
Delphi XE
BeitragVerfasst: Di 04.01.11 17:14 
Hey,
ja, es passierte einfach nix.

Ich hab jetzt hintendran ein Application.ProcessMessages eingefügt, nachdem ich gemerkt hatte dass es ganz zum Schluss doch auf 100% steht.
Jetzt wirds aktualisiert.

Danke :)