Autor |
Beitrag |
ts-d
      
Beiträge: 25
|
Verfasst: Di 26.05.09 06:19
Hauptprogramm öffnet Formular mit Progressbar, die anzeigt, wie lange die Datenübernahme noch braucht.
Am Ende versuche ich mit close das Formular mit der Progressbar zu schließen - geht nicht.
Auch ein Klick ins rechte obere Systemfeld schließt das Formular nicht.
Weiß jemand, warum?
|
|
ffgorcky
      
Beiträge: 573
WIN XP/2000 & 7Prof (Familie:Win95,Win98)
|
Verfasst: Di 26.05.09 08:43
Na, da wäre ja erstmal die Frage, ob Du das nicht nur immer wieder per Timer neu aufrufst...
Dann würde ich das ja so schreiben:
Delphi-Quelltext 1: 2: 3: 4:
| FormProgressBar.OnClose(ParameterWeißIchJetztNichtAusWendig); begin TimerFortschrittsHinweis.Enabled:=False; end; |
Ich hoffe, dass ich Dich damit nicht total verkehrt verstanden habe.
|
|
BenBE
      
Beiträge: 8721
Erhaltene Danke: 191
Win95, Win98SE, Win2K, WinXP
D1S, D3S, D4S, D5E, D6E, D7E, D9PE, D10E, D12P, DXEP, L0.9\FPC2.0
|
Verfasst: Di 26.05.09 10:04
Könntest Du bitte etwas Source zeigen, wie du mit deinem Progress-Form arbeitest?
_________________ Anyone who is capable of being elected president should on no account be allowed to do the job.
Ich code EdgeMonkey - In dubio pro Setting.
|
|
ts-d 
      
Beiträge: 25
|
Verfasst: Di 26.05.09 10:30
Ich verstehe deine Antwort nicht ganz: Mein Problem ist, dass das Formular sich am Ende nicht schließen lässt,
weder codegesteuert noch manuell durch Benutzerklick auf die Schliessen-Schaltfläche.
Der Timer hilft da wohl nicht weiter oder?
|
|
ts-d 
      
Beiträge: 25
|
Verfasst: Di 26.05.09 10:43
o.k. etwas Code:
Im Hauptformular läuft eine Importroutine - ein paar Zeilen sehen so aus:
Delphi-Quelltext 1: 2: 3: 4: 5: 6: 7:
| .... SQL.Clear; SQLText := 'UPDATE Auftragkopf SET STANDAUFTR8=''0'' WHERE STANDAUFTR8 IS NULL'; SQL.Add(SQLText); ExecSQL; ProgressBarAktualisieren; .... |
In der Routine ProgressBarAktualisieruen steht folgendes:
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:
|
procedure TMainForm.ProgressBarAktualisieren; var ProgressBarWert: Integer; ZeitDatenimport_X: TDateTime; begin
ZeitDatenimport_X := Now - ZeitDatenimport; ProgressBarWert := trunc(ZeitDatenimport_X / StrToDateTime('00:' + ImportZeit) * 100); if ProgressBarWert > 0 then Dialog_StatusInformation.ProgressBar.Position := ProgressBarWert else if ProgressBarWert >= 100 then begin Dialog_StatusInformation.ProgressBar.Position := 100; end;
Dialog_StatusInformation.ProgressBar.Refresh;
end; |
Nachdem der Import abgeschlossen ist, wird im Hauptformular die Zeile ausgeführt:
Delphi-Quelltext 1:
| Dialog_StatusInformation.Close; |
|
|
BenBE
      
Beiträge: 8721
Erhaltene Danke: 191
Win95, Win98SE, Win2K, WinXP
D1S, D3S, D4S, D5E, D6E, D7E, D9PE, D10E, D12P, DXEP, L0.9\FPC2.0
|
Verfasst: Di 26.05.09 10:44
Danke für das Effiziente Auslssen genau der wichtigen Zeilen:
Erzeugen des Progress-Forms, Anzeigen, Aktualisieren und Schließen ...
_________________ Anyone who is capable of being elected president should on no account be allowed to do the job.
Ich code EdgeMonkey - In dubio pro Setting.
|
|
ts-d 
      
Beiträge: 25
|
Verfasst: Di 26.05.09 10:52
Erzeugen des Progress-Formulars:
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:
| unit StatusInformation;
interface
uses Windows, SysUtils, Classes, Graphics, Forms, Controls, StdCtrls, Buttons, ExtCtrls, ComCtrls, jpeg, Dialogs;
type TDialog_StatusInformation = class(TForm) Image1: TImage; ProgressBar: TProgressBar; Label_Information: TLabel;
private public t: Integer; end;
var Dialog_StatusInformation: TDialog_StatusInformation;
implementation
{$R *.DFM} end. |
Anzeigen des Progress-Formulars:
Delphi-Quelltext 1:
| Dialog_StatusInformation.Show; |
Das Schließen des Formulars hast du schon - das hast du vielleicht übersehen ... 
|
|
MDX
      
Beiträge: 595
Erhaltene Danke: 4
Windows 8.1, Linux Debian 8, Android Lollipop
Delphi, PHP, Java (Android)
|
Verfasst: Di 26.05.09 12:45
Er meinte glaub ich eher die komplette Procedure oder Function die das Öffnet und Schließt, den wie man ein Formulaer öffnet ist im sicherlich bekannt und ist auch mit Show/Showmodal und Close die leichteste (und vielleicht einzigste?) Möglichkiet.
Also schreib deine Procedure oder Funktion in der das Formular geöffnet wird, sonst kann dir niemand richtig helfen. (Denke ich?)
|
|
|