Forum > LCL

Current position of the progress bar

(1/2) > >>

Pe3s:
Hi, how can I calculate the current position of the progress bar if I know the length of a music track or movie?

Thaddy:
scale to 100%, position is at  X% (very simple 12 year old math)

Pe3s:

--- 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";}};} ---pbar.value:= pbar.ClientWidth * duration ?????

bytebites:

--- 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";}};} ---ProgressBar1.Min:=0;ProgressBar1.Max:=100;  ProgressBar1.Position:=trunc(music.position/duration*100);Application.ProcessMessages;

howardpc:

--- Quote from: Thaddy on May 15, 2022, 10:43:47 am ---scale to 100%, position is at  X% (very simple 12 year old math)

--- End quote ---
@Thaddy
Sometimes your advice is negated by the way you belittle the questioner. Suppose the questioner is a refugee who has had no formal education at primary or teenage level?
If you can't resist adding a snide comment to complete your advice I feel it would be better that you not offer any response.

Navigation

[0] Message Index

[#] Next page

Go to full version