Why FolderBrowserDialog dialog does not scroll to selected folder?

前端 未结 14 1593
失恋的感觉
失恋的感觉 2020-11-30 02:28

As show in this screen shot, the selected folder is not in the view. It needs to be scrolled down to view the selected folder.

14条回答
  •  失恋的感觉
    2020-11-30 02:55

    The best approach, at least the most reliable is to make your own browser class dialog box. The tree scrolling issue has been a pain for many years - it will never get fixed!

    If you know how to render in paint there is not much you can't do.. fast in paint well that is another story.

    The first place I would look is at the open source .Net source code on GitHub, in your .Net version of choice, for the dialog class you're interested in improving. You may be surprised what you can achieve with a little effort and follow through. Just duplicate the control and debug to the point where the error occurs and patch - that'a what Microsoft does, so too can you!

    Since this is an old thread and posting samples may never get read. It would make more since to post if asked.

    Yet for someone looking to solve such an issue as with tree scrolling to the "expected" directory, here is some solid advise. If an issue exists with a control or library that has no immediate solution, create your own version, when possible extend the original and patch the problem. I've revamped everything from the Windows.Form.Control class to Win32 libraries for the sole purpose of getting predictable and accurate results.

    The good news is that with C# there is a lot of low level control available to achieve almost any reasonable objective and the is C too.

    In the past I have spent way too many hours searching for a solution to a problem where had I just recreated what was not working a lot of time would have been saved.

提交回复
热议问题