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. ComboBox in WIN32 programming.

ComboBox in WIN32 programming.

Scheduled Pinned Locked Moved C / C++ / MFC
question
3 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.
  • B Offline
    B Offline
    birajendu
    wrote on last edited by
    #1

    I created a combo box using the fllowing createwindowex() function. m_hWnd = CreateWindowEx( NULL, L"ComboBox", L"Appliance Name", WS_CHILD | WS_VISIBLE | CBS_HASSTRINGS | CBS_DROPDOWNLIST , 10, 0, 200, 30, hwndParent, (HMENU) IDC_MAIN_COMBOBOX, GetModuleHandle(NULL), NULL); And added two strings using the CB_ADDSTRING message. Still when i click the dropdownbox. it is not opening the list box.just a thik line only appears below that Combobox. Can any one detect what wrong I am doing?

    birajendu CyberG India Delhi India

    S 1 Reply Last reply
    0
    • B birajendu

      I created a combo box using the fllowing createwindowex() function. m_hWnd = CreateWindowEx( NULL, L"ComboBox", L"Appliance Name", WS_CHILD | WS_VISIBLE | CBS_HASSTRINGS | CBS_DROPDOWNLIST , 10, 0, 200, 30, hwndParent, (HMENU) IDC_MAIN_COMBOBOX, GetModuleHandle(NULL), NULL); And added two strings using the CB_ADDSTRING message. Still when i click the dropdownbox. it is not opening the list box.just a thik line only appears below that Combobox. Can any one detect what wrong I am doing?

      birajendu CyberG India Delhi India

      S Offline
      S Offline
      Sarath C
      wrote on last edited by
      #2

      Can you try with CB_SETMINVISIBLE [^]macro? This message sets the minimum number of visible items in the drop-down list of a combo box. Instead of using SendMesssage you can call ComboBox_SetMinVisible [^]macro and pass the number of elements required.

      -Sarath. "Great hopes make everything great possible" - Benjamin Franklin

      My blog - Sharing My Thoughts

      B 1 Reply Last reply
      0
      • S Sarath C

        Can you try with CB_SETMINVISIBLE [^]macro? This message sets the minimum number of visible items in the drop-down list of a combo box. Instead of using SendMesssage you can call ComboBox_SetMinVisible [^]macro and pass the number of elements required.

        -Sarath. "Great hopes make everything great possible" - Benjamin Franklin

        My blog - Sharing My Thoughts

        B Offline
        B Offline
        birajendu
        wrote on last edited by
        #3

        My issue was different. The problem was it required more clint area while drop down. case CBN_DROPDOWN: { RECT rcClient; // Get the coordinates of the parent window's client area. GetClientRect((HWND) lParam, &rcClient); MoveWindow((HWND)lParam,rcClient.left,rcClient.top ,rcClient.right,rcClient.bottom+300,true); } I added this above code. which fixed my issue.

        birajendu SonicWALL Bangalore India

        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