CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    May 1999
    Posts
    3

    ListBox (Scrollbar)

    Hi guys,
    I want to add an Horizantal scrollbar to a Listbox since the tems displayed are lengthier. If check the property 'H Scroll' It adds horiz..scrollbar. But the listbox items are displayed in manu columns.

    What i need is a listbox, which normally has a verti. scroll bar. If the length of the text in it exceeds the display area, a Horizantal scroll bar has to be added automatically to view it.

    Thanks,
    Ganeshbabu




  2. #2
    Join Date
    May 1999
    Posts
    116

    Re: ListBox (Scrollbar)

    You need to tell the listbox that it needs to activate the horz. scroll bar. It does not figure this out itsself. Each time you add a string, you will have to get the width of the string (using GetTextExtent) and if it if longer than any existing string call SetHorizontalExtent so the listbox knows to show the scroll bar.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured