home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / os / mswindo / programm / misc / 4305 < prev    next >
Encoding:
Text File  |  1992-12-17  |  2.8 KB  |  67 lines

  1. Newsgroups: comp.os.ms-windows.programmer.misc,comp.windows.ms.programmer
  2. Path: 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
  3. From: tope@enea.se (Tommy Petersson)
  4. Subject: Re: Query: Listbox, how to have horiz scroll but suppress vert scroll.
  5. Message-ID: <1992Dec17.092250.7424@enea.se>
  6. Organization: Enea Data AB
  7. X-Newsreader: Tin 1.1 PL3
  8. References: <1992Dec16.183940.12902@b23a.b23a.ingr.com>
  9. Date: Thu, 17 Dec 1992 09:22:50 GMT
  10. Lines: 55
  11.  
  12. wolf@web.b15.ingr.com (Wayne Wolf) writes:
  13. : Fellow Windows controls hackers...  I needa somea guidance
  14. : I am trying to create a poor-man's multicolumn gadget in windows without 
  15. : having to resort to too much custom control business.  To do this, I
  16. : am sticking listboxes side by side, making the rightmost listbox vertscroll.
  17. : This works great and everything plays in tandem.  However, the problem
  18. : is that I need also horizontal scrolling in each field of the multi-column
  19. : gadget.  This works like a charm also, except that when a listbox is declared
  20. : horizontal scroll, it by default becomes vertical scroll as well.  The
  21. : bugger with this is that those darned vertical scrollbars now pop-up on the
  22. : other listboxes instead of just the rightmost one.  VERY UGLY.  
  23. : My question here is, does anyone have any thoughts on how to solve this,
  24. : still using listboxes instead of custom controls?  Ideally, I would
  25. : like a way to just tell the listbox not to display its vertical scrollbar
  26. : at any time, but as far as I can tell, there is no support for this 
  27. : functionality (anytime the box overfills, a scrollbar automagically pops
  28. : up, no ifs-ands-buts).  I realize the listbox's capability for multiple 
  29. : columns, but the functionality of this is much too limiting.
  30. : Of course, if anyone is willing to share code/design for a custom control
  31. : for a multicolumn gadget, this would be even better. :-)
  32. : ..
  33. : Wayne Wolf
  34. : wolf@web.b15.ingr.com
  35.  
  36. Maybe this is a solution:
  37.  
  38. In Visual Basic it is not possible to declare a listbox "horizontal scroll",
  39. so I have used a (documented) "trick" to get one. This may be useful for
  40. you as well, I don't know.
  41.  
  42. In VB you prepare for the call with these lines:
  43.  
  44. Const LB_SETHORIZONTALEXTENT = &H400 + 21
  45. Const NUL = &O0
  46.  
  47. ListBx.SetFocus
  48. ListHwnd% = GetFocus()
  49. BoxWidth% = <VIRTUAL BOX WIDTH>
  50.  
  51. X& = SendMessage (ListHwnd%, LB_SETHORIZONTALEXTENT, BoxWidth%, NUL)
  52.  
  53. This gives me in VB a horizontal scroll bar but no vertical.
  54.  
  55. -- 
  56. =============================================================================
  57.  Tommy Petersson              tope@enea.se              Enea Data AB, Sweden
  58. =============================================================================
  59.  
  60.