Forum > LCL

[SOLVED] How to change color of TSplitter?

(1/1)

Slyde:
In my small application, I'm giving the users the ability to set form color.  And while I have this set

--- 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";}};} ---Splitter1.Color := frmMain.Color;Splitter2.Color := frmMain.Color;it still stays dove grey, even though the form itself changed color.  This is pretty straight-forward stuff, but it sure isn't working for me.

AlexTP:
Try this

--- 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";}};} ---    Splitter.OnPaint:= @SplitterOnPaintDummy;    Splitter.Color:= clRed; .... procedure TfmMain.SplitterOnPaintDummy(Sender: TObject);begin  //empty, to disable themed paintend; 

Slyde:
That worked. I wldve never guessed to do that. I guess it's good to have that way, though, giving splitters an out if you want them to stay grey when the form color changes.

Thanks for the help.

Hansvb:
Hi,

If I try the above, I lose the grip points. I assume that these also fall under the themed part. How can I change the color and keep the grip dots?

See the difference between left and right splitter. (Lazarus 3.0, win 11)

jamie:
I just did old 2.0.4 laz and the trunk,. it works fine here , I can set it to any color without that hack.

So maybe something has changed in the widget between these two?

Navigation

[0] Message Index

Go to full version