?
Solved

Default color change for the selected row

Posted on 2000-05-01
5
Medium Priority
?
202 Views
Last Modified: 2010-04-04
How can I change the default color for the selected row (default is blue) in a TDbGrid control ?
0
Comment
Question by:drnadeem
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 2

Expert Comment

by:mullet_attack
ID: 2768181
In TCustomDBGrid.DrawCell, this bit of code makes the selected cell's colors conform to the settings in Windows :

        if Highlight then
        begin
          Brush.Color := clHighlight;
          Font.Color := clHighlightText;
        end;

so, if you want to use other colors, set DefaultDrawing to false, and write your own routine in the OnDrawColumnCell event. You will have to consider selected or not, fonts, alignment and focus rectangle when you 'draw' the cell yourself.
0
 
LVL 1

Author Comment

by:drnadeem
ID: 2768475
This question has a deletion request Pending
0
 
LVL 2

Expert Comment

by:mullet_attack
ID: 2768699
This question no longer is pending deletion
0
 
LVL 2

Accepted Solution

by:
mullet_attack earned 80 total points
ID: 2768700
This appears to be an answer...

so, if you want to use other colors, set DefaultDrawing to false, and write your own routine in the OnDrawColumnCell event. You will have to consider selected or not, fonts, alignment and focus rectangle when you 'draw' the cell yourself.

0
 
LVL 1

Author Comment

by:drnadeem
ID: 2944362
Answer accepted
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Suggested Courses
Course of the Month15 days, 17 hours left to enroll

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question