🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.ms-windows.programmer.misc
Article #1981

Re: Query: Listbox, how to have horiz scroll but suppress vert scroll.

#1981
From: Tommy Petersson
Date: Thu, 17 Dec 1992 09:22
54 lines
2893 bytes
wolf@web.b15.ingr.com (Wayne Wolf) writes:
: 
: 
: Fellow Windows controls hackers...  I needa somea guidance
: 
: I am trying to create a poor-man's multicolumn gadget in windows without 
: having to resort to too much custom control business.  To do this, I
: am sticking listboxes side by side, making the rightmost listbox vertscroll.
: This works great and everything plays in tandem.  However, the problem
: is that I need also horizontal scrolling in each field of the multi-column
: gadget.  This works like a charm also, except that when a listbox is declared
: horizontal scroll, it by default becomes vertical scroll as well.  The
: bugger with this is that those darned vertical scrollbars now pop-up on the
: other listboxes instead of just the rightmost one.  VERY UGLY.  
: 
: My question here is, does anyone have any thoughts on how to solve this,
: still using listboxes instead of custom controls?  Ideally, I would
: like a way to just tell the listbox not to display its vertical scrollbar
: at any time, but as far as I can tell, there is no support for this 
: functionality (anytime the box overfills, a scrollbar automagically pops
: up, no ifs-ands-buts).  I realize the listbox's capability for multiple 
: columns, but the functionality of this is much too limiting.
: 
: Of course, if anyone is willing to share code/design for a custom control
: for a multicolumn gadget, this would be even better. :-)
: 
: ..
: 
: Wayne Wolf
: wolf@web.b15.ingr.com

Maybe this is a solution:

In Visual Basic it is not possible to declare a listbox "horizontal scroll",
so I have used a (documented) "trick" to get one. This may be useful for
you as well, I don't know.

In VB you prepare for the call with these lines:

Const LB_SETHORIZONTALEXTENT = &H400 + 21
Const NUL = &O0

ListBx.SetFocus
ListHwnd% = GetFocus()
BoxWidth% = <VIRTUAL BOX WIDTH>

X& = SendMessage (ListHwnd%, LB_SETHORIZONTALEXTENT, BoxWidth%, NUL)

This gives me in VB a horizontal scroll bar but no vertical.

-- 
=============================================================================
 Tommy Petersson              tope@enea.se              Enea Data AB, Sweden
=============================================================================
Technical Details
Message-ID: <1992Dec17.092250.7424@enea.se>
Path: arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!cs.utexas.edu!swrinde!emory!sol.ctr.columbia.edu!ira.uka.de!Sirius.dfn.de!mailgzrz.TU-Berlin.DE!news.netmbx.de!Germany.EU.net!mcsun!sunic!seunet!enea!tope
References: <1992Dec16.183940.12902@b23a.b23a.ingr.com>

Show Full Headers
Complete Article Headers
Newsgroups: comp.os.ms-windows.programmer.misc,comp.windows.ms.programmer
Path: arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!cs.utexas.edu!swrinde!emory!sol.ctr.columbia.edu!ira.uka.de!Sirius.dfn.de!mailgzrz.TU-Berlin.DE!news.netmbx.de!Germany.EU.net!mcsun!sunic!seunet!enea!tope
From: tope@enea.se (Tommy Petersson)
Subject: Re: Query: Listbox, how to have horiz scroll but suppress vert scroll.
Message-ID: <1992Dec17.092250.7424@enea.se>
Organization: Enea Data AB
X-Newsreader: Tin 1.1 PL3
References: <1992Dec16.183940.12902@b23a.b23a.ingr.com>
Date: Thu, 17 Dec 1992 09:22:50 GMT
Lines: 55