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. Read-Only ComboBox

Read-Only ComboBox

Scheduled Pinned Locked Moved C / C++ / MFC
c++jsontutorial
3 Posts 3 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.
  • F Offline
    F Offline
    Fareed Rizkalla
    wrote on last edited by
    #1

    I've been trying to find of a working sample, but no luck! I only managed to find MFC samples. If someone knows how to get one in place by logic or a sample for it in Windows API code.

    P S 2 Replies Last reply
    0
    • F Fareed Rizkalla

      I've been trying to find of a working sample, but no luck! I only managed to find MFC samples. If someone knows how to get one in place by logic or a sample for it in Windows API code.

      P Offline
      P Offline
      Peter_in_2780
      wrote on last edited by
      #2

      Depends what you mean by read-only. If you want the user to select from the drop-down list but not enter anything that is not on the list, then set the ComboBox style to CBS_DROPDOWNLIST (That's the name in winuser.h - your framework may have a different name). Cheers, Peter

      Software rusts. Simon Stephenson, ca 1994.

      1 Reply Last reply
      0
      • F Fareed Rizkalla

        I've been trying to find of a working sample, but no luck! I only managed to find MFC samples. If someone knows how to get one in place by logic or a sample for it in Windows API code.

        S Offline
        S Offline
        Sauro Viti
        wrote on last edited by
        #3

        What do you mean with "read only combobox"? If you mean a combobox whose content cannot be changed by the user, simply disable it (it becames grayed, but there is not other way, however you can make it ownerdrawn and draw it with normal colors either if it is disabled). If you mean a combobox where the user cannot type characters, but only select from a pre-defined list, use the CBS_DROPDOWNLIST style.

        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