Horizontal scroll bar in List box

Posted on 2006-05-26
Last Modified: 2012-05-05
This is something a co-worker and I have spent many hours on and absolutely cannot get it to work.  We have an ownerdrawn listbox... we need a horizontal scrollbar.  We have referenced this article:
Nothing... nothing at all happens.  No matter what we do, we cannot get a horizontal scrollbar to appear.  

We have this owner drawn because we need to fire an event to color text from the DrawItem event.  Everything works except this scrolling problem.

We are using .NET 2.0 and VS2005.  Anyone run into this before?

Thank you for reading this.
Question by:nvenable
    LVL 11

    Accepted Solution

    why dont you just set the HorizontalScrollbar property to true and let the HorizontalExtent at 0? is the scrollbar then visible?

    Author Comment

    Oh no!  I just realized something!  I picked this project up from my co-worker and realized that he set the scrollbars in the wrong place in the code.  The settings were getting overwritten after I set them in another place.

    I was setting the HorizontalExtent and HorizontalScrollbar values, but they were getting overwitten later with incorrect data.  Wow...and that only took 6 hours (between both of us tweaking on it).  I  feel kinda dumb.  But hey, at least you answered the question correctly :~} ... I think I am going to re-write this app in a cleaner fashion.

    Thank you for your assistance vo1d.

    Featured Post

    Maximize Your Threat Intelligence Reporting

    Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

    Join & Write a Comment

    Suggested Solutions

    Bit flags and bit flag manipulation is perhaps one of the most underrated strategies in programming, likely because most programmers developing in high-level languages rely too much on the high-level features, and forget about the low-level ones. Th…
    Article by: Ivo
    C# And Nullable Types Since 2.0 C# has Nullable(T) Generic Structure. The idea behind is to allow value type objects to have null values just like reference types have. This concerns scenarios where not all data sources have values (like a databa…
    Internet Business Fax to Email Made Easy - With eFax Corporate (, you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
    In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor ( If you're interested in additional methods for monitoring bandwidt…

    729 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now