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;

解决方案 »

  1.   

    ddddddddddddddddddddddddddddddddddddddddddddddddddd
      

  2.   

    Delphi. NET 没有用过,不知道,帮你顶一下。不过,vs.net 中可以使用DATAGRID或者DATALIST之类的控件来生成TABLE,可以设置Item和AlternatingItem的不同颜色背景。写代码来控制外观不合适。
      

  3.   

    哈哈,兄弟,我再搞哪个是也搞了好久,不过没你这么长,我大概是个把小时,好象,net有自己的color集合,你直接写color.试试看,或许能弄出来,还有什么style集合等等。直接写颜色不行了。
      

  4.   

    或者是font.什么的,反正类似了,你查下帮助可以找到大批这样的东西,估计,net自己定义了颜色结构
      

  5.   

    trow.BackColor:=color.XXXX(其中XXXX是你要的颜色,不过好像要在Uses中引用Borland.Vcl.SysUtils)