unit Unit1;interfaceuses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls, StdCtrls;type
TForm1 = class(TForm)
GroupBox1: TGroupBox;
RadioButton1: TRadioButton;
RadioButton2: TRadioButton;
Label1: TLabel;
Timer1: TTimer;
procedure FormCreate(Sender: TObject);
procedure RadioButton1Click(Sender: TObject);
procedure RadioButton2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;var
Form1: TForm1;implementation{$R *.dfm}procedure TForm1.FormCreate(Sender: TObject);
begin
if radiobutton1.Checked then
label1.Caption :=formatdatetime('ampmhh:nn:ss',time)
else
label1.Caption :=formatdatetime('hh:nn:ss',time);end;procedure TForm1.RadioButton1Click(Sender: TObject);
begin
Timer1timer(sender);
end;procedure TForm1.RadioButton2Click(Sender: TObject);
begin
timer1timer(sender);
end;end.
[错误] Unit1.pas(43): Undeclared identifier: 'timer1timer'
[错误] Unit1.pas(48): Undeclared identifier: 'timer1timer'
[致命错误] Project2.dpr(5): Could not compile used unit 'Unit1.pas'
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls, StdCtrls;type
TForm1 = class(TForm)
GroupBox1: TGroupBox;
RadioButton1: TRadioButton;
RadioButton2: TRadioButton;
Label1: TLabel;
Timer1: TTimer;
procedure FormCreate(Sender: TObject);
procedure RadioButton1Click(Sender: TObject);
procedure RadioButton2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;var
Form1: TForm1;implementation{$R *.dfm}procedure TForm1.FormCreate(Sender: TObject);
begin
if radiobutton1.Checked then
label1.Caption :=formatdatetime('ampmhh:nn:ss',time)
else
label1.Caption :=formatdatetime('hh:nn:ss',time);end;procedure TForm1.RadioButton1Click(Sender: TObject);
begin
Timer1timer(sender);
end;procedure TForm1.RadioButton2Click(Sender: TObject);
begin
timer1timer(sender);
end;end.
[错误] Unit1.pas(43): Undeclared identifier: 'timer1timer'
[错误] Unit1.pas(48): Undeclared identifier: 'timer1timer'
[致命错误] Project2.dpr(5): Could not compile used unit 'Unit1.pas'
解决方案 »
- DBGrid如何做多层表头?最好有代码,详细点
- delphi paintBox的问题
- 高分求助高手帮忙呀。急:在DELPHI下如何区别一个字符串是汉字而不是标点符号、英文字母或其它乱码?
- 如何将编译好的project1.exe (最小化显示),改其他名称如ddd.exe
- 100分急求,C语言代码转换为Pascal代码?
- InterBase7.1的驱动哪里有?
- 各位大侠,请教如何改变pagecontrol的页头的形状
- 百分大放送,非牛莫入!
- 请教,我在我的应用程序中要执行一个外部的批处理程序,该怎么做呢?
- 文本数据追加到数据库的问题
- Delphi2010的TclientDataSet访问有中文字段名的表时读取的字段名为乱码
- 求助,CONTROL[I].CLASSTYPE問題
要么你为你的timer1设置ontimer事件处理代码
在窗体设计器上选择timer1, F11,点开Event,在Ontimer右边的框里双击,然后在代码编辑器里输入代码
所以报无效的字符串错误再说啦,你的Timer1 控件在这里好像没有什么作用啊,
你写这个程序到底是为了什么?定时?还是其他?
定时的话,你设定Timer的Interval属性(毫秒数)。然后你直接控制Timer的Enabled属性。Timer1的Timer事件的意思是完成了消耗要进行的动作。