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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. CCombobox drawitem question

CCombobox drawitem question

Scheduled Pinned Locked Moved C / C++ / MFC
question
5 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.
  • T Offline
    T Offline
    Tarek Jabri
    wrote on last edited by
    #1

    Hi I have i combobox with dropdownlist style ( and ownerdrawfixed | havestrings) am filling it using addstring method how can i get the text of an item in the drawitem method? thanks alot

    H 1 Reply Last reply
    0
    • T Tarek Jabri

      Hi I have i combobox with dropdownlist style ( and ownerdrawfixed | havestrings) am filling it using addstring method how can i get the text of an item in the drawitem method? thanks alot

      H Offline
      H Offline
      Hamid Taebi
      wrote on last edited by
      #2

      if you use WM_DRAWITEM maybe it is some helpful to you CString str; GetLBText(lpDrawItem->itemID, str);

      T 1 Reply Last reply
      0
      • H Hamid Taebi

        if you use WM_DRAWITEM maybe it is some helpful to you CString str; GetLBText(lpDrawItem->itemID, str);

        T Offline
        T Offline
        Tarek Jabri
        wrote on last edited by
        #3

        thanks alot it worked fine in drawitem method after testing that the itemid is in the valid range of indices. but the items seems so close to each other, how can this be solved? and how can i remove the border from the edit area of the combo? again thanks alot for your help

        H 2 Replies Last reply
        0
        • T Tarek Jabri

          thanks alot it worked fine in drawitem method after testing that the itemid is in the valid range of indices. but the items seems so close to each other, how can this be solved? and how can i remove the border from the edit area of the combo? again thanks alot for your help

          H Offline
          H Offline
          Hamid Taebi
          wrote on last edited by
          #4

          for border see COMBOBOXINFO[^]

          1 Reply Last reply
          0
          • T Tarek Jabri

            thanks alot it worked fine in drawitem method after testing that the itemid is in the valid range of indices. but the items seems so close to each other, how can this be solved? and how can i remove the border from the edit area of the combo? again thanks alot for your help

            H Offline
            H Offline
            Hamid Taebi
            wrote on last edited by
            #5

            like this only enter numbers in combobox COMBOBOXINFO m_info; ZeroMemory(&m_info, sizeof(COMBOBOXINFO)); m_info.cbSize = sizeof(COMBOBOXINFO); m_Combo.GetComboBoxInfo(&m_info); ModifyStyle(m_info.hwndItem,0,ES_NUMBER,0);

            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