• Welcome to Valhalla Legends Archive.
 

ListView question

Started by Newby, May 08, 2004, 12:17 AM

Previous topic - Next topic

Newby

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.
- Newby

Quote[17:32:45] * xar sets mode: -oooooooooo algorithm ban chris cipher newby stdio TehUser tnarongi|away vursed warz
[17:32:54] * xar sets mode: +o newby
[17:32:58] <xar> new rule
[17:33:02] <xar> me and newby rule all

Quote<TehUser> Man, I can't get Xorg to work properly.  This sucks.
<torque> you should probably kill yourself
<TehUser> I think I will.  Thanks, torque.

Eli_1

#1
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.

Newby

Ah, thanks Eli. 240 worked best for me. :)

If anybody has any other ways though it'd be appreciated.
- Newby

Quote[17:32:45] * xar sets mode: -oooooooooo algorithm ban chris cipher newby stdio TehUser tnarongi|away vursed warz
[17:32:54] * xar sets mode: +o newby
[17:32:58] <xar> new rule
[17:33:02] <xar> me and newby rule all

Quote<TehUser> Man, I can't get Xorg to work properly.  This sucks.
<torque> you should probably kill yourself
<TehUser> I think I will.  Thanks, torque.

Noodlez

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).

Eli_1

#4
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.

Noodlez

#5
Change the resolution on your screen and see if it still works.
http://vbnet.mvps.org/code/subclass/lvscrollbars.htm

Eli_1

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.

FuzZ

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)