🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.delphi.database
Article #137

Re: DBGrid And Select

#137
From: Anthony Anderson
Date: Fri, 30 Jan 2004 14:39
17 lines
1439 bytes
You need to repaint the object after you have updated the colour. 

This is how I've done it for a combo box.

procedure TCombo.DrawItem(Index: Integer; Rect: TRect;
     State: TOwnerDrawState);
begin
  if odSelected in State then
  begin
    Canvas.Font.Color := FDropDownFontColor;
    Canvas.Brush.Color := FDropDownColor;
  end;
  Canvas.TextRect(Rect,Rect.Left,Rect.Top,Items.Strings[Index]);
end;

I'm not sure what the paint event is to call for a DBGrid though.
A.
Technical Details
Message-ID: <45bc45c6.0401300639.4bc51959@posting.google.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!postnews1.google.com!not-for-mail
References: <d32771b6.0401210847.17d9d348@posting.google.com> <400ee70b$1@clear.net.nz> <d32771b6.0401230808.4ec2a3c5@posting.google.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 115d96,b306e39286f4cabb
X-Google-Attributes: gid115d96,public
X-Google-ArrivalTime: 2004-01-30 06:39:40 PST
Path: arc1-ca.pugleaf.net!archiver1.google.com!postnews1.google.com!not-for-mail
From: aanderson@ldennehy.fsnet.co.uk (Anthony Anderson)
Newsgroups: borland.public.delphi.database
Subject: Re: DBGrid And Select
Date: 30 Jan 2004 06:39:40 -0800
Organization: http://groups.google.com
Lines: 17
Message-ID: <45bc45c6.0401300639.4bc51959@posting.google.com>
References: <d32771b6.0401210847.17d9d348@posting.google.com> <400ee70b$1@clear.net.nz> <d32771b6.0401230808.4ec2a3c5@posting.google.com>
NNTP-Posting-Host: 213.121.167.51
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
X-Trace: posting.google.com 1075473580 5156 127.0.0.1 (30 Jan 2004 14:39:40 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Fri, 30 Jan 2004 14:39:40 +0000 (UTC)