Home > Back-end >  How to change dbgrideh form the current row form line color?
How to change dbgrideh form the current row form line color?

Time:02-04

I want the user to edit the current data lines, line the dbgrideh form to change the color, in order to highlight, how to do?

Note: only the current line, not all line; Only change form line color can, need not modify the other colors,

CodePudding user response:

OptionEh - & gt; DghRowHighlight=true

CodePudding user response:

Eldest brother, see, I just change the color of the form line, not to change a whole line color,

OptionEh - & gt; DghRowHighlight=true, will highlight the entire line color, do not accord with my request,

CodePudding user response:

Haven't studied, look

CodePudding user response:

No one will be?

CodePudding user response:

Set the Canvas. The pen. The color, it is ok to redraw the

CodePudding user response:

My former DBGRIDEH can in DELPHI 5, do not know what version of DELPHI 7 is not it

CodePudding user response:

DrawColumnCell

The rect cell attributes, with canvas. Pen. Color to move

CodePudding user response:

DBGrid1. DefaultDrawColumnCell (the Rect, DataCol, the Column, the State);
With (Sender as TDBGrid). Canvas do//draw the border around the cell
The begin
Pen. Color:=$00 ff0000;//define brush color (blue)
MoveTo (the Rect. Left, the Rect. Bottom);//brush locate
LineTo (the Rect. Right, the Rect. Bottom);
//draw the blue linePen. Color:=$0000 ff00;//define brush color (green)
MoveTo (the Rect. Right, the Rect. Top);//brush locate
LineTo (the Rect. Right, the Rect. Bottom);//draw the green vertical lines
end;

CodePudding user response:

OptionEh - & gt; DghRowHighlight=true this attribute is really good, only to find that today

CodePudding user response:

Shao113112:
You said the process is a process of dbgrid bring? How do I didn't find, specific how to do?
  • Related