Adding horizontal scroll bar to a combo box


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 5 of 5

Thread: Adding horizontal scroll bar to a combo box

  1. #1
    Kevin McCormack Guest

    Adding horizontal scroll bar to a combo box


    Hello,

    (Newbie question) I am working on an reporting app that allows user to
    select parameters that are in a combo box. The problem is that the data
    in the combo box is much longer than the actual combo box. I am trying to
    allow the user to see all of the descriptions. So far I have tried increasing
    the drop-down width using cb_setdroppedwidth. While that worked on some
    combo boxes, it caused issues when the combo box was placed near the edge
    of the form.

    Does anyone have any suggestions on how to either add a scroll bar to the
    combo box....or other options that I may try? Would cb_sethorizontalextent
    work? Any suggestions would be appreciated.

    Thanks,
    Kevin

  2. #2
    Mattias Sjögren Guest

    Re: Adding horizontal scroll bar to a combo box

    Kevin,

    > Does anyone have any suggestions on how to either add a scroll bar to the
    >combo box....or other options that I may try? Would cb_sethorizontalextent
    >work?


    CB_SETHORIZONTALEXTENT only works if the conjtrol was created with the
    WS_HSCROLL style set. And unfortunately, the VB Combobox isn't. If you
    check out Matthew Curland's VBPJ article from about a year ago (I
    think it was called "Modify a control's style" or something like
    that), you might find a workaround. Your other options are to create
    the control yourself using the CreateWinwodEx API or find a third
    party control that supports it.


    Matt

    ============================================
    Mattias Sjögren - mattiass @ hem.passagen.se
    VB+ - http://hem.spray.se/mattias.sjogren/
    CodeHound - Free VB Search Engine
    http://www.codehound.com

  3. #3
    Mattias Sjögren Guest

    Re: Adding horizontal scroll bar to a combo box

    Kevin,

    > Does anyone have any suggestions on how to either add a scroll bar to the
    >combo box....or other options that I may try? Would cb_sethorizontalextent
    >work?


    CB_SETHORIZONTALEXTENT only works if the conjtrol was created with the
    WS_HSCROLL style set. And unfortunately, the VB Combobox isn't. If you
    check out Matthew Curland's VBPJ article from about a year ago (I
    think it was called "Modify a control's style" or something like
    that), you might find a workaround. Your other options are to create
    the control yourself using the CreateWinwodEx API or find a third
    party control that supports it.


    Matt

    ============================================
    Mattias Sjögren - mattiass @ hem.passagen.se
    VB+ - http://hem.spray.se/mattias.sjogren/
    CodeHound - Free VB Search Engine
    http://www.codehound.com

  4. #4
    mrfelis Guest

    Re: Adding horizontal scroll bar to a combo box

    I had a similar situation. I solved it by putting the item under the mouse
    into a tooltip. Eric has a sample of my code on his site:
    http://www.redleif.com/vb/example_so...tboxhover.html

    Where Eric has "Label1.Caption = List1.List(lR)" use "cbo.ToolTip =
    cbo.List(lR)". I've never tried this on a cbo so you might need to do some
    conversions.

    --
    ~~~
    C'Ya,
    mrfelis
    mrfelis@yahoo.NOSPAM.com
    just remove the spam
    Kevin McCormack <mccormackk@discovermercatus.com> wrote in message
    news:39770699$1@news.devx.com...
    >
    > Hello,
    >
    > (Newbie question) I am working on an reporting app that allows user to
    > select parameters that are in a combo box. The problem is that the data
    > in the combo box is much longer than the actual combo box. I am trying to
    > allow the user to see all of the descriptions. So far I have tried

    increasing
    > the drop-down width using cb_setdroppedwidth. While that worked on some
    > combo boxes, it caused issues when the combo box was placed near the edge
    > of the form.
    >
    > Does anyone have any suggestions on how to either add a scroll bar to

    the
    > combo box....or other options that I may try? Would

    cb_sethorizontalextent
    > work? Any suggestions would be appreciated.
    >
    > Thanks,
    > Kevin




  5. #5
    mrfelis Guest

    Re: Adding horizontal scroll bar to a combo box

    I had a similar situation. I solved it by putting the item under the mouse
    into a tooltip. Eric has a sample of my code on his site:
    http://www.redleif.com/vb/example_so...tboxhover.html

    Where Eric has "Label1.Caption = List1.List(lR)" use "cbo.ToolTip =
    cbo.List(lR)". I've never tried this on a cbo so you might need to do some
    conversions.

    --
    ~~~
    C'Ya,
    mrfelis
    mrfelis@yahoo.NOSPAM.com
    just remove the spam
    Kevin McCormack <mccormackk@discovermercatus.com> wrote in message
    news:39770699$1@news.devx.com...
    >
    > Hello,
    >
    > (Newbie question) I am working on an reporting app that allows user to
    > select parameters that are in a combo box. The problem is that the data
    > in the combo box is much longer than the actual combo box. I am trying to
    > allow the user to see all of the descriptions. So far I have tried

    increasing
    > the drop-down width using cb_setdroppedwidth. While that worked on some
    > combo boxes, it caused issues when the combo box was placed near the edge
    > of the form.
    >
    > Does anyone have any suggestions on how to either add a scroll bar to

    the
    > combo box....or other options that I may try? Would

    cb_sethorizontalextent
    > work? Any suggestions would be appreciated.
    >
    > Thanks,
    > Kevin




Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center