Valhalla Legends Archive

Programming => General Programming => C/C++ Programming => Topic started by: warz on July 28, 2005, 03:35 PM

Title: Disable listview horizontal scroll
Post by: warz on July 28, 2005, 03:35 PM
When an item longer than the width of the listview of mine is added to it - scroll bars appear at the bottom. I've scourged MSDN with no luck. Anyone know how to disable these horizontal scroll bars?
Title: Re: Disable listview horizontal scroll
Post by: MyndFyre on July 28, 2005, 04:43 PM
Does calling ShowScrollBar (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/commctls/scrollbars/scrollbarreference/scrollbarfunctions/showscrollbar.asp) with the parameters of your listview's HWND, SB_HORZ, and FALSE work?
Title: Re: Disable listview horizontal scroll
Post by: warz on July 28, 2005, 06:34 PM
Well, it returns non-zero meaning it worked - but the scroll bar still appears.
Title: Re: Disable listview horizontal scroll
Post by: Yegg on July 28, 2005, 07:25 PM
At one time I came across this problem with Visual Basic 6, and could not solve the problem. Had you been using a library such as wxWidgets, you could fix such a problem.
Title: Re: Disable listview horizontal scroll
Post by: Warrior on July 28, 2005, 07:59 PM
Quote from: Yegg on July 28, 2005, 07:25 PM
At one time I came across this problem with Visual Basic 6, and could not solve the problem. Had you been using a library such as wxWidgets, you could fix such a problem.

..wow.
Title: Re: Disable listview horizontal scroll
Post by: Yegg on July 28, 2005, 08:08 PM
See? Even Warrior agrees.
Title: Re: Disable listview horizontal scroll
Post by: Warrior on July 28, 2005, 09:21 PM
You can easily disable that in VB6.
Title: Re: Disable listview horizontal scroll
Post by: Yegg on July 28, 2005, 09:41 PM
Actually, I believe I asked how to fix the problem in either these forums or in forums.devshed.com, and no one could provide adequate help for the problem.

PS. I'm not going to respond to this thread any more since I do not want it to get too off-topic.
Title: Re: Disable listview horizontal scroll
Post by: MyndFyre on July 28, 2005, 10:01 PM
How about using FindWindowEx (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/winui/windowsuserinterface/windowing/windows/windowreference/windowfunctions/findwindowex.asp) to find the child window of your ListView, specifying the SBS_HORZ class name, then call ShowWindow (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/winui/windowsuserinterface/windowing/windows/windowreference/windowfunctions/findwindowex.asp), with the SW_HIDE message?

You might need to do hide it each time the ListView is updated.
Title: Re: Disable listview horizontal scroll
Post by: DarkMinion on August 05, 2005, 08:49 PM
Or you could just not use a ListView  :P
Title: Re: Disable listview horizontal scroll
Post by: warz on August 06, 2005, 12:27 PM
And us a.. ? :-\
Title: Re: Disable listview horizontal scroll
Post by: MyndFyre on August 06, 2005, 01:32 PM
Quote from: warz on August 06, 2005, 12:27 PM
And us a.. ? :-\

I assume you mean "And as a replacement?"

Try subclassing a ListBox.