Quantcast
Channel: Active questions tagged listview - Stack Overflow
Viewing all articles
Browse latest Browse all 611

Legacy Delphi 7 TListView scrollbar scrolls cause bad screen flash/refresh [closed]

$
0
0

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?


Viewing all articles
Browse latest Browse all 611

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>