6

I use the WebBrowser-Control to view the Content of a folder.

On windows 10 there is a Display-Bug, after reordering the content, when the selected Item moves from bottom to top.

Let's reproduce:

  1. Start a clean winform or wpf Solution
  2. drag the WebBrowser-Control inside
  3. add Code to navigate to your custom Folder e.g:

    public Form1() { InitializeComponent(); webBrowser1.Navigate(@"C:\tmp\yourfolder\"); }

  4. start application, switch to Details-View if needed (with right click - context-menu) WebBrowser Control showing local folder in DetailView

  5. Sort by Name-Column, Select first Entry

  6. Sort by Name-Column to move item to end

selected item is scrolled to bottom

  1. Sort by Name-Column again to move selected item to top

showing scrollbar, window and list are not in sync

You'll see, scrollbar, window and list are not in sync. The Scrollbar moved up, but the Item didn't move to the first position in the list. Also the item is only visible after Mouse-Over. Also dragging the scroll-bar a little, doesn't heal this misbehavior.

Does anybody has an idea how to overcome this? I was thinking of forcing the shellfolderview to redraw by calling InvalidateRect or sending a WM_PAINT Message to the hooked SysListView32, but with no success.

And yes, I want to show the list with the details-View :-).

How to solve this?

gReX
  • 1,060
  • 1
  • 20
  • 35
  • Tested with winver 1703 – gReX Dec 22 '17 at 11:48
  • SysListView32 is working on Windows 7 – gReX Dec 22 '17 at 11:48
  • 1
    May I ask what the use case is of using the web browser to navigate files instead of `OpenFileDialog`? I mean you are literally using the web browser control not to view html/ web stuff, but explore the local file system. Why not use a winforms control specifically designed for that? – Alexander Ryan Baggett Dec 26 '17 at 21:53
  • The use case is to embed a Explorer-looking view for Navigation and selection in my Application. – gReX Jan 08 '18 at 08:21
  • I tried the same code in WPF application and its working for me. I use windows 10 OS build 14393.1944 – Gaurang Dave Jan 09 '18 at 01:01
  • I used OS Build 15063.674 – gReX Jan 09 '18 at 08:16
  • Found some Infos that Problems with SysListView32 startetd with creators Update: https://answers.microsoft.com/en-us/windows/forum/windows_10-security/important-syslistview32-bug-with-multiple-items/9e6198f7-a38a-4614-bc89-4781a9bde748?tm=1509985739913&auth=1 – gReX Jan 09 '18 at 08:17
  • You see only the Problem, if you have enough items in the List, see the scrollbar in my pictures. – gReX Jan 09 '18 at 08:20
  • still can reproduce with wpf solution and winver 15063.850 – gReX Jan 09 '18 at 11:15
  • I followed your instructions, but can't reproduce it. – Alexander Ryan Baggett Jan 12 '18 at 19:08
  • If you have this problem you cannot tackle with the stock stuff...check this thread. An explorer window isn't too difficult to create https ://stackoverflow.com/questions/2416963/how-to-create-an-explorer-like-folder-browser-control – Ctznkane525 Jan 15 '18 at 03:35
  • @Alexander Ryan Baggett Which Windows-Version did you checked? (you will get version by tpye winver in cmd) – gReX Jan 15 '18 at 14:24

1 Answers1

1

This Windows-Bug is present at least in Windows-10-Version 1703 15063.674 and 15063.850. (Creators Update)

Other Issues with this Version are reported here: https://answers.microsoft.com/en-us/windows/forum/windows_10-security/important-syslistview32-bug-with-multiple-items/9e6198f7-a38a-4614-bc89-4781a9bde748?tm=1509985739913&auth=1

In Fall Creators Update the Bug is gone. I tested with 1709 Build 16299.125

@Gaurange Dave could not reproduce the bug with Anniversary Update. He tested with Build 14393.1944.

So just update Windows 10. Thanks everybody for help.

gReX
  • 1,060
  • 1
  • 20
  • 35