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