delphi2005下开发WEB程序,其中我想在程序中控制table每行的颜色,但给色时,还delphi标准的用法不同了,不能用 clBlue ,clRed等等,测试了好长时间,还是搞不定。!!请大家给调一下。
(注意,是2005选的 ASP.NET WEB application,不是一般的win程序)
以下是部分代码:var
trow:tablerow;
tcell1:tablecell;
tcell2:tablecell;
i:integer;
j:integer;
tt:integer;
begin
j:=10;
for i:=0 to j-1 do
begin
trow:=tablerow.Create;
tcell1:=tablecell.Create;
tcell2:=tablecell.Create;
trow.Cells.Add(tcell1);
trow.Cells.Add(tcell2);
if ((i+1) mod 2=0) then
begin
trow.Font.Bold :=true;
// trow.BackColor :=button1.backColor; 这样把窗体上按钮的色取下来是可以的。
// trow.BackColor:= clBlue; 这样不可以,提示 clBlue 没定义!
// trow.BackColor:=$6699CC; 也不可以。。真不知道用什么表示。。
// 并且它需要的是 color 类型的值,怎么表示呢??
end
else
begin
trow.Font.Bold :=false;
end;
trow.Cells[0].Text :='测试001';
trow.Cells[1].Text :='测试002';
table1.Rows.Add(trow);
end;
(注意,是2005选的 ASP.NET WEB application,不是一般的win程序)
以下是部分代码:var
trow:tablerow;
tcell1:tablecell;
tcell2:tablecell;
i:integer;
j:integer;
tt:integer;
begin
j:=10;
for i:=0 to j-1 do
begin
trow:=tablerow.Create;
tcell1:=tablecell.Create;
tcell2:=tablecell.Create;
trow.Cells.Add(tcell1);
trow.Cells.Add(tcell2);
if ((i+1) mod 2=0) then
begin
trow.Font.Bold :=true;
// trow.BackColor :=button1.backColor; 这样把窗体上按钮的色取下来是可以的。
// trow.BackColor:= clBlue; 这样不可以,提示 clBlue 没定义!
// trow.BackColor:=$6699CC; 也不可以。。真不知道用什么表示。。
// 并且它需要的是 color 类型的值,怎么表示呢??
end
else
begin
trow.Font.Bold :=false;
end;
trow.Cells[0].Text :='测试001';
trow.Cells[1].Text :='测试002';
table1.Rows.Add(trow);
end;
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货