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

  1. Newsgroups: comp.os.ms-windows.programmer.misc
  2. Path: sparky!uunet!psinntp!panix!rryan
  3. From: rryan@panix.com (Rob Ryan)
  4. Subject: Re: where is my listbox horizontal scrollbar?
  5. Message-ID: <1992Dec17.152555.5592@panix.com>
  6. Date: Thu, 17 Dec 1992 15:25:55 GMT
  7. References: <MUFFY.92Dec16182741@remarque.berkeley.edu>
  8. Organization: Panix, NYC
  9. Lines: 24
  10.  
  11. In <MUFFY.92Dec16182741@remarque.berkeley.edu> muffy@remarque.berkeley.edu (Muffy Barkocy) writes:
  12.  
  13. >I have created an MDI child window which has a listbox as its child.
  14. >When I resize the MDI child window, I resize the listbox to fit in it.
  15. >The listbox is created with WS_HSCROLL and WS_VSCROLL.  The vertical
  16. >scroll bar is fine, but the horizontal one refuses to appear.  I tried
  17. >doing a "ShowScrollBar," and it flashes in briefly, but then goes away
  18. >again, even if I have resized the window so small that the listbox items
  19. >definitely do not fit.
  20.  
  21. I think that you probably have to do LB_SETHORIZONTALEXTENT too, to tell
  22. Windows how wide the items are.  Unlike the vertical scroll bar, listboxes
  23. don't keep track of where the scroll bar should be.
  24.  
  25. Incidentally, if you use MFC, there's a wonderful example of deriving your
  26. own class from an existing class.  Thus, I derived a class CListHorz from
  27. CListBox, redefined AddString, InsertString, DeleteString, and ResetContent
  28. to calculate the extent and do the CListBox::SetHorizontalExtent() so the
  29. horizontal scrollbar of listboxes are updated automatically.  If you can't
  30. find the example, I can probably post the code.
  31.  
  32. -- 
  33.  Rob Ryan
  34.     rryan@panix.com
  35.