Другие языки программирования и технологии
progressbar как заставить работать этот компанент???
Да хоть для любого вычисления...даже хоть 2+2
Вставляешь компонент timer помоему во вкладке system и progressbar и дважды щелкни на timer1 и туда впиши
begin
ProgressBar1.Position:= ProgressBar1.Position+1;
end;
после этого он у тебя просто сходит от значения о до значение 100 и встанет. А так как ты хочешь 2+2 эт не работает)))
begin
ProgressBar1.Position:= ProgressBar1.Position+1;
end;
после этого он у тебя просто сходит от значения о до значение 100 и встанет. А так как ты хочешь 2+2 эт не работает)))
Александр Фартыгин
Я имел в виду привязать его к процессу, например долгий процесс вычисления стал бы не так нуднен если видеть скоко до его конца...
{
This example requires two ProgressBars, two labels and a
Memo. The ProgressBar and the label captions are updated as
the mouse moves inside the Memo.
}
procedure TForm1.FormCreate(Sender: TObject);
begin
ProgressBar1.Min := 0;
ProgressBar1.Max := Memo1.Width;
ProgressBar2.Min := 0;
ProgressBar1.Max := Memo1.Height;
end;
procedure TForm1.Memo1MouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
begin
Label1.Caption := InttoStr(X);
Label2.Caption := InttoStr(Y);
ProgressBar1.Position := X;
ProgressBar2.Position := Y;
end;
Reads through all records in the Customers table.
Updates the ProgressBar accordingly.
}
procedure TForm1.Button1Click(Sender: TObject);
var
i: Integer;
begin
with ProgressBar1 do
begin
Min := 0;
Max := Customers.RecordCount;
Customers.First;
for i := Min to Max do
begin
Position := i; // гляди сюды, о, чудо, оно движется !!!
Customers.Next;
// do something with the current record
end;
end;
end;
procedure TForm1.FormCreate(Sender: TObject);
var
i: Integer;
begin
Customers:= TTable.Create(Form1);
with Customers do
begin
DatabaseName := 'DBDEMOS';
TableType := ttParadox;
TableName := 'CustInfo';
Active := False;
// Overwrite any existing table
if Customers.Exists then
begin
Customers.Close;
Customers.DeleteTable;
end;
begin
{ The Table component must not be active }
{ First, describe the type of table and give }
{ it a name }
{ Next, describe the fields in the table }
with FieldDefs do
begin
Clear;
with AddFieldDef do
begin
Name := 'Field1';
DataType := ftInteger;
Required := True;
end;
with AddFieldDef do
begin
Name := 'Field2';
DataType := ftString;
Size := 30;
end;
end;
{ Next, describe any indexes }
with IndexDefs do
begin
Clear;
{ The 1st index has no name because it is
{ a Paradox primary key }
with AddIndexDef do
begin
Name := '';
Fields := 'Field1';
Options := [ixPrimary];
end;
with AddIndexDef do
begin
Name := 'Fld2Indx';
Fields := 'Field2';
Options := [ixCaseInsensitive];
end;
end;
{ Call the CreateTable method to create the table }
CreateTable;
Customers.Active:= True;
for i := 1 to 100 do
Customers.AppendRecord([i*111, i*222]);
end;
end;
DS2.DataSet:= Customers;
DBGrid2.DataSource.DataSet:= Customers;
Customers.Active:= True;
end;
This example requires two ProgressBars, two labels and a
Memo. The ProgressBar and the label captions are updated as
the mouse moves inside the Memo.
}
procedure TForm1.FormCreate(Sender: TObject);
begin
ProgressBar1.Min := 0;
ProgressBar1.Max := Memo1.Width;
ProgressBar2.Min := 0;
ProgressBar1.Max := Memo1.Height;
end;
procedure TForm1.Memo1MouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
begin
Label1.Caption := InttoStr(X);
Label2.Caption := InttoStr(Y);
ProgressBar1.Position := X;
ProgressBar2.Position := Y;
end;
Reads through all records in the Customers table.
Updates the ProgressBar accordingly.
}
procedure TForm1.Button1Click(Sender: TObject);
var
i: Integer;
begin
with ProgressBar1 do
begin
Min := 0;
Max := Customers.RecordCount;
Customers.First;
for i := Min to Max do
begin
Position := i; // гляди сюды, о, чудо, оно движется !!!
Customers.Next;
// do something with the current record
end;
end;
end;
procedure TForm1.FormCreate(Sender: TObject);
var
i: Integer;
begin
Customers:= TTable.Create(Form1);
with Customers do
begin
DatabaseName := 'DBDEMOS';
TableType := ttParadox;
TableName := 'CustInfo';
Active := False;
// Overwrite any existing table
if Customers.Exists then
begin
Customers.Close;
Customers.DeleteTable;
end;
begin
{ The Table component must not be active }
{ First, describe the type of table and give }
{ it a name }
{ Next, describe the fields in the table }
with FieldDefs do
begin
Clear;
with AddFieldDef do
begin
Name := 'Field1';
DataType := ftInteger;
Required := True;
end;
with AddFieldDef do
begin
Name := 'Field2';
DataType := ftString;
Size := 30;
end;
end;
{ Next, describe any indexes }
with IndexDefs do
begin
Clear;
{ The 1st index has no name because it is
{ a Paradox primary key }
with AddIndexDef do
begin
Name := '';
Fields := 'Field1';
Options := [ixPrimary];
end;
with AddIndexDef do
begin
Name := 'Fld2Indx';
Fields := 'Field2';
Options := [ixCaseInsensitive];
end;
end;
{ Call the CreateTable method to create the table }
CreateTable;
Customers.Active:= True;
for i := 1 to 100 do
Customers.AppendRecord([i*111, i*222]);
end;
end;
DS2.DataSet:= Customers;
DBGrid2.DataSource.DataSet:= Customers;
Customers.Active:= True;
end;
Александр Фартыгин
епать и куда это все пихать????о_0
У него задается целых 3 параметра:
ProgressBar1.Min:=0; \\ минималка
ProgressBar1.Max:=2; \\ максималка
ProgressBer1.Position:=тут какой-нить начение, позиция полоски
ProgressBar1.Min:=0; \\ минималка
ProgressBar1.Max:=2; \\ максималка
ProgressBer1.Position:=тут какой-нить начение, позиция полоски
Похожие вопросы
- Как заставить работать OpenGL?
- Как удалить программу, если она находится в прграммы и компаненты и при нажатии удалить выдает ошибку)))
- как заставить торрент работать быстрее???
- Как заставить себя программировать!???Как заставить себя программировать!???
- Как заставить мп3 плеер texet t-808 на базе rockchip rk2608a выводить информацию о компе
- как заставить ету прогу упак и неупак. BCD (асемблер, масм32)
- Как заставить Яндекс проиндексировать сайт повторно?
- Люди работающие с рисунками на компьютере помогите.
- Почему многие розничные типографии и верстальщики частники работают в основном на ADOBE, а оптовом на CorelDraw?
- Как работает программирование? Какая физическая основа у программирования?