Главная страница
    Top.Mail.Ru    Яндекс.Метрика
Форум: "WinAPI";
Текущий архив: 2004.03.14;
Скачать: [xml.tar.bz2];

Вниз

Pomogite c Stop Watch   Найти похожие ветки 

 
Mohamed   (2004-01-07 00:12) [0]

Uvajaemie mastera Delphi Pomogite pojaloista, vot uvas text pragramma
Ia khatchu delat sekundamer gde tam Start I Sbros (Button1Click:SetTimer, Button1Click:KillTimer);
Ashibka v (Button1Click:SetTimer и Button1Click:KillTimer);
Not enough actual parameters.

unit Unit1;

interface

uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ComCtrls, ExtCtrls, StdCtrls;

type
TForm1 = class(TForm)
Timer1: TTimer;
ProgressBar1: TProgressBar;
Button1: TButton;
Button2: TButton;
Label1: TLabel;
procedure Timer1Timer(Sender: TObject);
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;

var
Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.Timer1Timer(Sender: TObject);
begin
Form1.Hide;
with ProgressBar1 do
Position:=Position+1;
if progressbar1.Position=100 then
Form1.Show;
//Tak i khotel zdes dobavit takoe functse chto bi pokazala na Caption u Label1
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
Button1Click:SetTimer;
end;

procedure TForm1.Button2Click(Sender: TObject);
begin
Button1Click:KillTimer;
end;

end.


 
Delphi5.01   (2004-01-07 10:14) [1]

Izvenite za pramotu, no vi zdes namudrili takoe chto mne ponadobilos 5 minut chtob ponat chto vi hoteli zdelat! Vot privoju kod programii, kotori po meemu vas i interesuet!

unit Unit1;

interface

uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls, StdCtrls, ComCtrls;

type
TForm1 = class(TForm)
Button1: TButton;
Button2: TButton;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;

var
Form1: TForm1;
TimerStop: Boolean; //ukazivaet rabotaet taimer ili ostanvlen
StartTime: Integer; //nachlnoe znachenie vremeni
implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
begin
StartTime:=GetTickCount; //procedura vozrashaet znachenie vremeni v milisekundax
//vrema kotoroe proshlo s zapuska kompa
TimerStop:=False; //a znachit zapuskaem timer
while Not TimerStop do
begin
form1.Caption:="Time: "+IntToStr(GetTickCount-StartTime); //vichislau skolko
//vremeni proshlo, i vivoju znachenie na ekran
Application.ProcessMessages; //nujen dla togo chtob proga ne zavisala
//proisxodilo obnovlenie
if Application.Terminated then //esli ktoto popitalsa otrubit programu
exit;
end;
end;

procedure TForm1.Button2Click(Sender: TObject);
begin
TimerStop:=True; //ostanavlivau taimer
end;

end.
//no voobshe dla etoi celi ispolzovat Thread, i ne vkoem sluchee ne ispolzuite
//Timer, on daiot bolshie oshibki vo vremeni

Jelau udachi



Страницы: 1 вся ветка

Форум: "WinAPI";
Текущий архив: 2004.03.14;
Скачать: [xml.tar.bz2];

Наверх




Память: 0.45 MB
Время: 0.011 c
1-43435
DVM
2004-03-03 19:57
2004.03.14
Алгоритм Антиалиазинга


4-43949
kor@lex
2004-01-06 20:28
2004.03.14
hint


1-43431
Layner
2004-03-01 09:50
2004.03.14
Как редактировать строки в ListView?


1-43629
Silver_
2004-03-01 19:28
2004.03.14
Трабл с XPManifest-ом в D7. В D6 все OK


14-43842
Думкин
2004-02-22 06:14
2004.03.14
С днем рождения! 22 февраля.





Afrikaans Albanian Arabic Armenian Azerbaijani Basque Belarusian Bulgarian Catalan Chinese (Simplified) Chinese (Traditional) Croatian Czech Danish Dutch English Estonian Filipino Finnish French
Galician Georgian German Greek Haitian Creole Hebrew Hindi Hungarian Icelandic Indonesian Irish Italian Japanese Korean Latvian Lithuanian Macedonian Malay Maltese Norwegian
Persian Polish Portuguese Romanian Russian Serbian Slovak Slovenian Spanish Swahili Swedish Thai Turkish Ukrainian Urdu Vietnamese Welsh Yiddish Bengali Bosnian
Cebuano Esperanto Gujarati Hausa Hmong Igbo Javanese Kannada Khmer Lao Latin Maori Marathi Mongolian Nepali Punjabi Somali Tamil Telugu Yoruba
Zulu
Английский Французский Немецкий Итальянский Португальский Русский Испанский