ListView and VScrollBar.
-
Hi @all, I have a ListView and a VScrollBar (I need the Scroll event...) on it with ListView.Scrollable set to false, because the ListView's ScrollBar would be on top always, so that I could not access my VScrollBar. But my problem is: How can I access the ListViewItems that are not visible? I tried to call the EnsureVisible() method at the Scroll event . The result was: The VScrollBar scrolled but the ListViewItems that are not visble didn't scrolled into view. It seems to be that the EnsureVisible() method only take effect if ListView.Scrollable is set to true. It must be a simple work - it drives me crazy! Please help!
-
Hi @all, I have a ListView and a VScrollBar (I need the Scroll event...) on it with ListView.Scrollable set to false, because the ListView's ScrollBar would be on top always, so that I could not access my VScrollBar. But my problem is: How can I access the ListViewItems that are not visible? I tried to call the EnsureVisible() method at the Scroll event . The result was: The VScrollBar scrolled but the ListViewItems that are not visble didn't scrolled into view. It seems to be that the EnsureVisible() method only take effect if ListView.Scrollable is set to true. It must be a simple work - it drives me crazy! Please help!
If you make your control not scrollable, it won't scroll. I doubt there is a simple way around this, it's doing what you asked it to. Christian Graus - Microsoft MVP - C++
-
Hi @all, I have a ListView and a VScrollBar (I need the Scroll event...) on it with ListView.Scrollable set to false, because the ListView's ScrollBar would be on top always, so that I could not access my VScrollBar. But my problem is: How can I access the ListViewItems that are not visible? I tried to call the EnsureVisible() method at the Scroll event . The result was: The VScrollBar scrolled but the ListViewItems that are not visble didn't scrolled into view. It seems to be that the EnsureVisible() method only take effect if ListView.Scrollable is set to true. It must be a simple work - it drives me crazy! Please help!
It could be possible to modify control styles to get rid of the scroll bar - must be done through interop though (calling into Win32 API) and still have control thinking it is there (by setting scrollbar's visible to false or similar). I don't think it is too easy as I had a lot of hard time fidling around ListView - it has a lot of strange behaviours under .NET (did you know it is owner-drawn under .NET at all times?) Regards JP
-
Hi @all, I have a ListView and a VScrollBar (I need the Scroll event...) on it with ListView.Scrollable set to false, because the ListView's ScrollBar would be on top always, so that I could not access my VScrollBar. But my problem is: How can I access the ListViewItems that are not visible? I tried to call the EnsureVisible() method at the Scroll event . The result was: The VScrollBar scrolled but the ListViewItems that are not visble didn't scrolled into view. It seems to be that the EnsureVisible() method only take effect if ListView.Scrollable is set to true. It must be a simple work - it drives me crazy! Please help!