Current position of the progress bar lazarus / 31-LCL ---------------------------------------------------------------------- Pe3s · 2022-05-15 08:34 Hi, how can I calculate the current position of the progress bar if I know the length of a music track or movie? ---------------------------------------------------------------------- Thaddy · 2022-05-15 08:43 scale to 100%, position is at  X% (very simple 12 year old math) ---------------------------------------------------------------------- Pe3s · 2022-05-15 09:30 Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i pbar.value:= pbar.ClientWidth * duration ????? ---------------------------------------------------------------------- bytebites · 2022-05-15 09:54 Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i ProgressBar 1.Min:=0;ProgressBar1.Max:=100;  ProgressBar1.Position:=trunc(music.po sition/duration*100);Application.ProcessMessages; ---------------------------------------------------------------------- howardpc · 2022-05-15 17:14 Quote from: Thaddy on May 15, 2022, 10:43:47 amscale to 100%, position is at  X% (very simple 12 year old math) @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. ---------------------------------------------------------------------- 440bx · 2022-05-15 19:13 @Thaddy, I have to concur with @howardpc and, FYI, putting people down doesn't make you look good, on the contrary.