Label not updating with TTrackBar lazarus / 31-LCL ---------------------------------------------------------------------- geraldholdsworth · 2022-02-13 16:43 Has anyone come across this issue: I have a TTrackBar and a TLabel in a TGroupBox on a form. When the TTrackBar changes it fires off the OnChange event to update the label. This works fine on macOS, but on Windows the TLabel doesn't change. The OnChange procedure fires OK, and I've tried Repainting, Refreshing and Updating the form, groupbox and label. Nothing works, that I can think of. On another form (in the same project), I have a TTrackBar and a TLabel on the form, but not inside any box or panel. The similar code for this works perfectly and the label updates as the trackbar is changed. This is on both version 2.0.12 and 2.2 of Lazarus. ---------------------------------------------------------------------- wp · 2022-02-13 17:21 I cannot confirm this (Win 11, Laz-main/fpc-3.2.2, Laz 2.2/fpc-3.2.2, Laz 2.0.12/fpc-3.2.0) - see attachment. What is different in your case? ---------------------------------------------------------------------- geraldholdsworth · 2022-02-13 17:33 How weird...your project works fine in both macOS and Windows. There is no difference between the two - same methods, similar code. ---------------------------------------------------------------------- geraldholdsworth · 2022-02-14 09:00 Quote from: jamie on February 13, 2022, 08:12:55 pmI am willing to bet that you renamed the label somewhere manually instead of using the OI to do this? Nope, never did anything like that. Quote from: jamie on February 13, 2022, 08:12:55 pmOpen the LFM file for the windows port and ensure you don't have another label in there that isn't what you think it should be. Both the Windows and macOS (and Linux for that matter) use the same files - they're on a shared OneDrive folder that all systems can access. Quote from: jamie on February 13, 2022, 08:12:55 pmThe loading of the components will create a label that is in the LFM but not what you are seeing in your class file in front of you, thus you can sit there all day to make changes and nothing happens or appears not to happen. I had a look anyway, but could not find anything that looks out of place. ---------------------------------------------------------------------- Thaddy · 2022-02-14 09:08 In that case, if it still does not work, send us code that can replicate this. As wp's code works anywhere I could test. ---------------------------------------------------------------------- wp · 2022-02-14 09:37 Remove everything from your code which is not needed to show the issue. Verify that the result still contains the error (often the bug goes away in this reduction step). Then zip the .pas, .lfm, .lpi, .lpr files and upload them to the forum. ---------------------------------------------------------------------- geraldholdsworth · 2022-02-14 09:42 I took the unit out and put it into another project, and the fault came with it. I then noticed that the TTrackBar went over the TLabel - that's why it wasn't updating. The odd thing is that the label was showing despite being obscured by the trackbar. Once I resized both, the label now updates. A silly mistake, easily missed it seems. Thrown by the red herring that it works fine on macOS. Thank you everyone for your assistance.