Forum > Databases

[SOLVED] DBGrid remove red rectangle selection

(1/1)

Pe3s:
Hello, is it possible to remove the red rectangle from the active selection?

Nicole:
yes

write into the event

DBGrid1ColumnCell(Sender: TObject;
   const Rect: TRect; DataCol: Integer; Column: TColumn; State: TGridDrawState);


--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---      if (gdSelected in State) then Canvas.Font.Color:= clBlue;

dsiders:

--- Quote from: Pe3s on December 06, 2022, 05:58:25 pm ---Hello, is it possible to remove the red rectangle from the active selection?

--- End quote ---

The focus rectangle gets drawn when DefaultDrawing is enabled. You can turn DefaultDrawing off and provide you own OnDraw* handlers.

Or you can change FocusColor to a color more pleasing to you.

paweld:
https://lazarus-ccr.sourceforge.io/docs/lcl/grids/tcustomgrid.focusrectvisible.html

--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---DBGrid1.FocusRectVisible := Fasle; 

Pe3s:
Thank you  :)

Navigation

[0] Message Index

Go to full version