07-03-2025, 01:50 AM
09-03-2025, 10:08 AM
السلام عليكم
مثال عام :
مثال على الطبع :
مثال عام :
PHP كود :
unit Unit1;
interface
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.ComCtrls, Vcl.StdCtrls;
type
TForm1 = class(TForm)
ProgressBar1: TProgressBar;
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var
i: Integer;
begin
ProgressBar1.Position := 0; // Reset progress bar
ProgressBar1.Max := 100; // Set max value
for i := 1 to 100 do
begin
Sleep(50); // Simulate a process (e.g., printing, calculation)
ProgressBar1.Position := i; // Update progress bar
Application.ProcessMessages; // Keep UI responsive
end;
ShowMessage('Process Completed!');
end;
end.
مثال على الطبع :
PHP كود :
procedure TForm1.PrintDocument;
var
i: Integer;
begin
Printer.BeginDoc;
ProgressBar1.Position := 0;
ProgressBar1.Max := 10; // بافتراض 10 خطوات في عملية الطباعة
for i := 1 to 10 do
begin
Sleep(200);// محاكاة تأخير الطباعة
ProgressBar1.Position := i;
Application.ProcessMessages;
end;
Printer.EndDoc;
ShowMessage('Printing Complete!');
end;
09-03-2025, 02:37 PM
شكرا لك وجزاك الله خيرا علي المساعدة