Membuat ProgressBar di StatusBar dengan Delphi agan" pasti sudah pada tau kali ya, bagi yang belum tau silahkan Simak Coding dibawah ini :
procedure TForm1.FormCreate(Sender: TObject);
var
ProgressBarStyle: integer;
begin
StatusBar1.Panels[1].Style := psOwnerDraw;
ProgressBar1.Parent := StatusBar1;
//Untuk menghapus border progress bar
ProgressBarStyle := GetWindowLong(ProgressBar1.Handle, GWL_EXSTYLE);
ProgressBarStyle := ProgressBarStyle
- WS_EX_STATICEDGE;
SetWindowLong(ProgressBar1.Handle,GWL_EXSTYLE,ProgressBarStyle);
end;
procedure TForm1.StatusBar1DrawPanel(StatusBar: TStatusBar;
Panel: TStatusPanel; const Rect: TRect);
begin
if Panel = StatusBar.Panels[1] then
with ProgressBar1 do begin
Top := Rect.Top;
Left := Rect.Left;
Width := Rect.Right - Rect.Left - 15;
Height := Rect.Bottom - Rect.Top;
end;
end;
procedure TForm1.BitBtn1Click(Sender: TObject);
var
i : integer;
begin ProgressBar1.Visible:=True;
ProgressBar1.Position := 0;
ProgressBar1.Max := 100;
for i := 0 to 100 do
begin
ProgressBar1.Position := i;
Sleep(15);
if ProgressBar1.Position = 100 then
begin
ProgressBar1.Position := 0;
ProgressBar1.Visible:=false;
end
end;
end;
"KOMENX" DULU DONK "
Maaf, di jalankan Error "List Index Out of Bounds (0)"
ReplyDeletekalau pengen yang lebih gampang tanpa coding, si progresbarnya di Cut lalu Pastekan ke statusbar gan...
Delete