cxGrid の現在の選択範囲の色をどのように変更しますか?
ありがとうございました。
グリッドのビューの「スタイル」プロパティを展開し、「選択」スタイルの (新しい) スタイル リポジトリに新しいスタイルを作成することで、選択にスタイルを割り当てることができます。フォームに作成されたスタイル リポジトリ コンポーネントをダブルクリックして、スタイルのプロパティを設定します。
より細かく制御するには、グリッドのビューの「OnCustomDrawCell」イベントを実装し、そこに色を設定できます。
procedure TForm1.cxGrid1DBTableView1CustomDrawCell(
Sender: TcxCustomGridTableView; ACanvas: TcxCanvas;
AViewInfo: TcxGridTableDataCellViewInfo; var ADone: Boolean);
begin
if(AViewInfo.Selected) and (Screen.ActiveControl = Sender.Site) then begin
ACanvas.Brush.Color := clGreen;
ACanvas.Font.Color := clFuchsia;
end;
end;