Flickering with TScrollbox lazarus / 31-LCL ---------------------------------------------------------------------- simsee · 2023-10-10 21:57 I have a similar problem to the one described in the following video: https://www.youtube.com/watch?v=jo7FUPy5SEU In my case I have a form containing a scrollbox. The form caption shows the current coordinates of the mouse pointer. If the scrollbars are visible, the edge of the scrollnox flickers. If I set the BorderStyle to bsNone, the problem does not occur. Can anything be done to avoid this problem? Thank you. ---------------------------------------------------------------------- KodeZwerg · 2023-10-10 22:01 Quote from: simsee on October 10, 2023, 11:57:16 pmCan anything be done to avoid this problem?Yes. Quote from: simsee on October 10, 2023, 11:57:16 pmThank you.You are welcome. Ps. for better help you should provide a test project that shows your problem. ---------------------------------------------------------------------- simsee · 2023-10-10 22:07 Thanks for the support. The problem arises under Windows o.s. (Lazarus 2.2.6 - FPC 3.2.2 x86_64-win64-win32/win64) . See attached project to reproduce. ---------------------------------------------------------------------- dsiders · 2023-10-10 22:34 Quote from: simsee on October 11, 2023, 12:07:56 amThanks for the support. The problem arises under Windows o.s. (Lazarus 2.2.6 - FPC 3.2.2 x86_64-win64-win32/win64) . See attached project to reproduce. The flicker is the border for the control being redrawn. Set the BorderStyle for the TScrollBox to bsNone and the problem is gone. ---------------------------------------------------------------------- simsee · 2023-10-10 22:41 As I wrote in my initial post, I already know this solution. I would like to know if there are alternatives to eliminating the border. ---------------------------------------------------------------------- jamie · 2023-10-10 22:44 Turn off the border as stated and drop the scrollbox inside a Tpanel, the Panel has border control that is actually better and it does not flicker like that.  Just do a CUT of your current scrollbox and Paste inside the Panel, Set the Align=Client for the scrollbox. etc. ---------------------------------------------------------------------- KodeZwerg · 2023-10-10 22:48 In attachment is a possible fix/solution. Flickering with my way = zero. ---------------------------------------------------------------------- jamie · 2023-10-10 23:01 I never use a scrollbox alone anyways. THe border is never on. ---------------------------------------------------------------------- KodeZwerg · 2023-10-11 15:54 Since topic is not marked as solved, I like to ask what is still wrong / not working? Quote from: simsee on October 11, 2023, 12:41:53 amI would like to know if there are alternatives to eliminating the border.I showed you an alternate way how everything can stay like it is and you still can manipulate the Caption in whatever way. Eliminating the Border/Redraw would cause more troubles, it is better to let OS mechanic do its things normally. ---------------------------------------------------------------------- simsee · 2023-10-11 16:36 Sorry for the delay, I've been busy at work. Both proposed solutions solve the problem, which I believe does not occur with other widgetsets under Linux (Qt, GTK). I haven't tried it, but I report what I read in the comments of the YouTube video I linked. Thanks for the support. ---------------------------------------------------------------------- Martin_fr · 2023-10-11 16:47 It should be reported: https://gitlab.com/freepascal.org/lazarus/lazarus/-/issues ---------------------------------------------------------------------- Martin_fr · 2023-10-11 16:56 It may be the scrollbars AutoScroll property. Disabling that (and just setting the scrollbars) => seems fine ---------------------------------------------------------------------- Martin_fr · 2023-10-11 17:56 Please test with https://gitlab.com/freepascal.org/lazarus/lazarus/- /commit/4891f1f0e1aebe5903daeff49bd6360b34e09eea ---------------------------------------------------------------------- Martin_fr · 2023-10-11 18:11 There is still an issue though. Timer with interval=10 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 procedure TForm1.Timer1Timer(Sender: TObject);begin  Invalidate;end; And it still flickers. https://gitlab.com/freepascal.org/lazarus/lazarus/-/issues/40548 ---------------------------------------------------------------------- simsee · 2024-02-10 16:24 It seems to me that with the version of Lazarus 3.0 - FPC 3.2.2 x86_64-win64-win32/win64, the fickering problem I reported has been resolved. I am grateful to those who can confirm this on other platforms as well. Thanks to the development team.