Change Font Color 1st Row of Each Table

General TRichView support forum. Please post your questions here
Post Reply
Sergey Tkachenko
Site Admin
Posts: 17566
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Before selecting in a cell, activates editing of this cell:

Code: Select all

procedure TForm3.ChangeTableHeaderFontColor(RVData: TCustomRVData; RVE: TCustomRichViewEdit);
var
   I: Integer;
   Table: TRVTableItemInfo;
   Row, Column: Integer;
begin
   for I := 0 to RVData.ItemCount - 1 do
      if RVData.GetItemStyle(I) = rvsTable then
       begin
          [color=red]RVData := RVData.Edit;[/color]
          Table := TRVTableItemInfo(RVData.GetItem(I));
          Table.SelectRows(0, 1);
          rvActionFontColor1.UserInterface := rvacNone;
          rvActionFontColor1.Color := clWhite;
          rvActionFontColor1.ExecuteTarget(RVE);
          rvActionFontColor1.UserInterface := rvacAdvanced;
          for Row := 0 to Table.RowCount - 1 do
             for Column := 0 to Table.ColCount - 1 do
                if Assigned(Table.Cells[Row, Column]) then
                   ChangeTableHeaderFontColor(
                     Table.Cells[Row, Column].GetRVData, RVE);
       end;
end;
Post Reply