Forum > LCL

[SOLVED] Panel bar

(1/1)

Pe3s:
Hello forum members, I wanted to create a custom bar from the TPanel component. I wrote the beginning, but I was concerned with the calculation of the position of the bar.

--- 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";}};} ---procedure TForm1.Panel2MouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer);var  NewX, Max: Integer;begin  if not(ssLeft in Shift) then Exit;  NewX := X + Panel2.Left;  Max := Panel1.ClientWidth - Panel2.Width;  if NewX < 0 then NewX := 0;  if NewX > Max then NewX := Max;  Panel2.Left := NewX;end; 0. zero point
1st belt position
2.100%
Can I ask for help in finalizing?

howardpc:
Do you mean something like the attached adapted project?

Pe3s:
That's exactly what I wanted to do. Thank you very much. Greetings with a smile :)

Navigation

[0] Message Index

Go to full version