0

すべてはタイトルにあります。行ごとにカスタマイズ可能な Officehint を作成するにはどうすればよいでしょうか。行上で mousemove を実行すると、このレコードの情報が表示されます (db クエリから)。

ありがとう

4

2 に答える 2

0

CellPropertiesグリッドのプロパティを使用して、個々のセルに色を付けることができます。これを使用して、行全体に色を付けることができます。

var
  RowIndex: Integer;
  ColIndex: Integer;

with MyDBAdvGrid do
begin
  // you choose the row index; you may want to iterate all rows to 
  // color each of them
  RowIndex := 2;
  // now iterate all (non-fixed, visible) cells in the row and color each cell
  for ColIndex := FixedCols to ColCount - 1 do
  begin
    CellProperties[ColIndex, RowIndex].BrushColor := clYellow;
    CellProperties[ColIndex, RowIndex].FontColor := clGreen;
  end;
end;

オフィスのヒントを記録データで埋めるには、ユーザーがマウスを動かしたときに更新することをお勧めします。関数を使用しMouseToCellてマウスの下の行と列を取得し、次に を使用MyDBAdvGrid.AllCells[ColIndex, RowIndex]してセルの内容にアクセスします。

于 2011-08-18T11:19:27.000 に答える
0

ハインリッヒの答えに代わるものは、OnGetCellColorイベントを使用することです。

これは次のように使用できます。

procedure TDBAdvGrid.DBGridGetCellColor(Sender: TObject; ARow,
  ACol: Integer; AState: TGridDrawState; ABrush: TBrush; AFont: TFont);
begin
     if (your condition) then ABrush.Color := clRed;
end;

ヒントについても同様です。

procedure TDBAdvGrid.DBGridGridHint(Sender: TObject; ARow, ACol: Integer;
  var hintstr: String);
begin
    hintstr := 'your hint text';
end;
于 2011-08-19T02:38:03.640 に答える