Главная страница
    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.013 c
3-43317
Rafe
2004-02-17 13:46
2004.03.14
Как программно выделить текущую строку в DBGrid?


1-43657
exp
2004-03-01 20:47
2004.03.14
Передача в процедуру двумерного массива


7-43924
SkySlider
2003-12-22 13:14
2004.03.14
Обращение к принтеру


7-43912
Retro
2003-12-23 22:16
2004.03.14
Присоедениния exe к фаилу *.doc или excel


3-43359
segor
2004-02-15 11:14
2004.03.14
Описание полей и FK таблицы IB





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
Английский Французский Немецкий Итальянский Португальский Русский Испанский