Dseligo, Yours absolutely does the job, I downloaded your example project that you kindly shared, it also compiles perfectly.
So I copied the code from 'your button 1' and placed it into one of my buttons 'button 2'.
I get instant compile errors, attached an image.
This likely indicates that something is wrong with wither my whole project, or Lazarus is miss-configured. I suspect my project is most likely
I am wondering if my Lazarus or EC-Controls is not installed/configured properly, I am actually having consistent issues with Lazarus since trying to edit an old application I made with Delphi3 in 1997. Actually I have a bunch of applications that I made over the years with VB3..6, Delphi3..10, Basic that I started to replicate in Lazarus. So that I use one standard platform.
I would do it like this:
procedure TForm1.Button1Click(Sender: TObject);
var i: Integer;
begin
For i := 0 to Pred(ControlCount) do
If Controls[i] is TECSlider then
With (Controls[i] as TECSlider).Knob do begin
BevelWidth:=2;
Color:=clHighlight;
Cursor:=crHandpoint;
Height:=32;
Style := eosButton;
TickMarkCount:=1;
TickMarkDesign:=etdSimple;
TickmarkSpacing:=2;
TickmarkStyle:=etsSolid;
Width:=40;
end;
end;