unit Unit1;interfaceuses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;type
TForm1 = class(TForm)
ListBox1: TListBox;
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;var
Form1: TForm1;
count1:Integer;
// a,b,c:Integer;implementation{$R *.dfm}procedure TForm1.Button1Click(Sender: TObject);
begin
count1:=count1+1;
if (count1 mod 2=1) then
ListBox1.Items.Add('HELLO WORLD!');
else
ListBox1.Items.Add('HELLO FRIEND!');
end;end.
后面的判断,我分别注释后都能显示出来,但是放一起就会报错。请问原因。Delphi
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;type
TForm1 = class(TForm)
ListBox1: TListBox;
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;var
Form1: TForm1;
count1:Integer;
// a,b,c:Integer;implementation{$R *.dfm}procedure TForm1.Button1Click(Sender: TObject);
begin
count1:=count1+1;
if (count1 mod 2=1) then
ListBox1.Items.Add('HELLO WORLD!');
else
ListBox1.Items.Add('HELLO FRIEND!');
end;end.
后面的判断,我分别注释后都能显示出来,但是放一起就会报错。请问原因。Delphi
解决方案 »
- 简单问题帮忙
- 请问那里可以买到专门讲OBJECT PASCAL 的书(非电子版)
- TreeView中有个属性HideSelection,若我选种它的子项,便需使它的父项的Text有阴影?
- 唉,又过了一年!!
- 请问如何在图片区域使鼠标中间的滑轮有效,实现图片中滚动页面?
- 连续打印(打印机Epson1600II)的报表设置问题?
- 如何对表中的两条记录的字段求和或相除,并输出
- 在delphi中怎样删除事件
- 精彩的控件,大家去down吧
- 红旗Linux哪儿有下载啊?
- DELPHI7开发的程序可以运行 xp 32 xp64 win7 32 WIN7 64 吗
- list index out of bounds(0)错误,不知道大家都遇到过吗
if (count1 mod 2=1) then
ListBox1.Items.Add('HELLO WORLD!') // 这里不能有分号,因为这句话没说完,下面还有 否则
else
ListBox1.Items.Add('HELLO FRIEND!');
end;