Forum > LCL

[SOLVED] ProgressBar mouse click

(1/1)

Pe3s:
Hello, I am curious if I can write better progressbar control with the mouse ?

--- 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.JvSpecialProgress1MouseDown(Sender: TObject;  Button: TMouseButton; Shift: TShiftState; X, Y: Integer);begin  if Button = mbLeft then    begin      newPos := Round(X * JvSpecialProgress1.Maximum / JvSpecialProgress1.ClientWidth);    JvSpecialProgress1.Position := newPos;end;end;  

ASerge:

--- Quote from: Pe3s on September 30, 2022, 06:44:02 pm ---Hello, I am curious if I can write better progressbar control with the mouse ?

--- End quote ---
In the general case Min + Round(X * (Max - Min) / Width).

Pe3s:
Thank you  :)

Navigation

[0] Message Index

Go to full version