Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Combo box Dropdown length

Combo box Dropdown length

Scheduled Pinned Locked Moved C / C++ / MFC
helpcsharpc++visual-studiojson
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    Donguy1976
    wrote on last edited by
    #1

    Hello I am working on C++ using Win32 API’s in Visual Studio 2008 environment, and am using almost all standard Windows controls that’s available. In the application there’s a Combo box that will show multiple items and have a horizontal and vertical scroll bar. There is an option for user, by which the user can choose the number of items shown in combo box. The combo box works fine when there more than 2 items to show, the scroll bars work fine. But when there’s only one item to show in combo box, the vertical scroll bar is very small. That is, the drop down of the combo box is not long enough to have a longer vertical scroll bar. That looks like the standard behavior of Windows combo box. But the application that am working on is used in a touch screen monitor. So the problem with a small vertical scroll bar is that, user will not have enough space to touch and scroll. The issue is more complicated is because, the 1st item in the combo box is always a empty string item. This is to make sure that there’s no default selection in combo box. So anyone has any idea how to have a longer drop down for a combo box with fewer items to display? So that the vertical scroll bar is longer. Is there a way of overriding Windows Combo box function? Like doing a SubclassDlgItem() or some other function? Thanks in advance.

    L 1 Reply Last reply
    0
    • D Donguy1976

      Hello I am working on C++ using Win32 API’s in Visual Studio 2008 environment, and am using almost all standard Windows controls that’s available. In the application there’s a Combo box that will show multiple items and have a horizontal and vertical scroll bar. There is an option for user, by which the user can choose the number of items shown in combo box. The combo box works fine when there more than 2 items to show, the scroll bars work fine. But when there’s only one item to show in combo box, the vertical scroll bar is very small. That is, the drop down of the combo box is not long enough to have a longer vertical scroll bar. That looks like the standard behavior of Windows combo box. But the application that am working on is used in a touch screen monitor. So the problem with a small vertical scroll bar is that, user will not have enough space to touch and scroll. The issue is more complicated is because, the 1st item in the combo box is always a empty string item. This is to make sure that there’s no default selection in combo box. So anyone has any idea how to have a longer drop down for a combo box with fewer items to display? So that the vertical scroll bar is longer. Is there a way of overriding Windows Combo box function? Like doing a SubclassDlgItem() or some other function? Thanks in advance.

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      You need to set the height value of your ComboBox as described in MSDN[^].

      MVP 2010 - are they mad?

      D 1 Reply Last reply
      0
      • L Lost User

        You need to set the height value of your ComboBox as described in MSDN[^].

        MVP 2010 - are they mad?

        D Offline
        D Offline
        Donguy1976
        wrote on last edited by
        #3

        Are you sure this will fix the problem? Because i think it will over all increase the height of combo box, rather than increasing the drop down. Can you please explain?

        L 1 Reply Last reply
        0
        • D Donguy1976

          Are you sure this will fix the problem? Because i think it will over all increase the height of combo box, rather than increasing the drop down. Can you please explain?

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #4

          Donguy1976 wrote:

          Are you sure this will fix the problem?

          What happens when you try it?

          MVP 2010 - are they mad?

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups