In an old app I'm maintaining using Delphi 7, a virtual TListView looks ugly by blanking the whole list and repainting it when using the scrollbar, yet it scrolls very nicely when using the mouse wheel. I'm looking for some code to override the TListView scrolling via the scrollbar and replace it with the actions of the mouse wheel? It would be very much appreciated. I'm not an expert in this area. In my research, it may be related to Themes and background painting, so perhaps I can fix that code but need lots of help.
Ok, it's not Themes as I disabled that and it still has the problem, but I discovered what is causing it. The app adds a Manifest which sets the Microsoft.Windows.Common-Controls to 6.0.0.0, and this causes it. However, I looked in comctrls.pas and found this code and thought I would try changing it and it also worked, but I'm concerned if it may cause some issue I'm not aware of. I removed the ThemesEnabled code...
procedure TCustomListView.WMVScroll(var Message: TWMVScroll);var Before, After: Integer;begin {if ThemeServices.ThemesEnabled then begin Before := GetScrollPos(Handle, SB_VERT); inherited; After := GetScrollPos(Handle, SB_VERT); if (Before <> After) then InvalidateRect(Handle, nil, True); end else} inherited;end;
Anyone see a problem with that?