Yapmak istediğim DBGrid-e seçili alanı rengini değiştirmek. Bunu yapmak istedim ancaq
beceremedim.
Bende böyle kodun ListBox için olanı var.
Kod: Tümünü seç
procedure TForm1.ListBox1DrawItem(Control: TWinControl; Index: Integer;
Rect: TRect; State: TOwnerDrawState);
begin
if odSelected in State then
begin
(Control as TListBox).Canvas.Brush.Color := clred;
(Control as TListBox).Canvas.Font.Color := clWhite;
end;
(Control as TListBox).Canvas.FillRect( Rect );
(Control as TListBox).Canvas.TextOut(Rect.left, Rect.top, (Control as TListBox).Items[Index]);
end;
Ekdeki resime baka bilirsiniz.