Would there be any way to detect if the scroll bars are visible/enabled or not?
That way I could resize my columns according to whether the scroll bar is there or not :).
Any help would be appreciated.
You might be able to get around that problem some ghetto way. Like:
y = ListView.Height / x
If ListView.ListItems.Count >= y Then
There might be scrollbars, if there isn't, your probably
only off by one.
Else
There's no scrollbars
End If
I tryed to do it after I read this post. I used 220 for 'x' and it seemed to work ok.
Ah, thanks Eli. 240 worked best for me. :)
If anybody has any other ways though it'd be appreciated.
If you plan on distributing the program, I would find a more solid method. As demonstrated, that number is going to change from system to system (for Eli it was 220 for you it was 240).
No it won't, I just got my number using a guess and check method. His number just happens to be closer -- 240 works better for me also.
Change the resolution on your screen and see if it still works.
http://vbnet.mvps.org/code/subclass/lvscrollbars.htm
I tryed that before I posted my answer. First time I did it on 1024x768, and second time I did it on 800x600. The end result never changed.
Quote from: Noodlez on May 08, 2004, 06:07 PM
Change the resolution on your screen and see if it still works.
http://vbnet.mvps.org/code/subclass/lvscrollbars.htm
I think it's based on text/icon size, not resolution.
Obviously, if you increase your text size from 9 to 11 it's going to be a larger size. As far as I can tell by reading this and my current knowledge you wouldn't have to worry about it unless you have dynamic font size (which would be nice for different resolutions)