Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
660
How to let Scrollbar appear after changing ImageSize?
posted

I'm using the UltraListView in Icon-View. For every Item i'm assigning an image. These images are 512x512 pixels in size.

By default, the user sees the ListView with a smaller imagesize like 80x80 for example. He can then move a slider on the form to resize the images from 16x16 up to 512x512.

This resizing is done via (lvBrowser is the UltraListView in IconView-Mode):

            this.lvBrowser.ViewSettingsIcons.ImageSize = new Size(ultraTrackBar1.Value, ultraTrackBar1.Value);

This works great but with one problem:

At some point the Icons are too big to fit on the screen inside the ListView - so normally i would expect to get a vertical Scrollbar automatically, but this doesn't work. No Scrollbar appears!

The Scrollbar appears after i resize the form a little bit (the ListView is dock=fill on a panel which can be resized by resizing the form or moving a slider). This little resize makes the ListView showing it's scrollbar - but that's not a solution, right? :)

I've tried: lvBrowser.Update(); and .Refresh() and .Invalidate() with no success.

Thanks a lot

  • 660
    posted

    Here is a work around:

    After setting the "ImageSize" it helps if you set the "ItemSize" to a new value too. Hope that will help others too :)

  • 69832
    Suggested Answer
    Offline posted

    I am speculating but most likely the scroll metrics are not being updated in this scenario; you might want to report this as a bug.