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. Combo box height is not increasing

Combo box height is not increasing

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

    Hi Guys, I have a list control containing 3 columns, When i click on any item in the list box it again pops up a combo box. But problem is that when i am tring to increase the height of the combo box it's not increasing and reamain same always. I am giving you the whole code. please tell me how to fix this problem. I am trying to increase the rect.bottom but its not increasing. void CListAgr::OnListLButton(WPARAM wParam, LPARAM lParam) { UINT nFlags = lParam; int iItem = wParam; int iItem = m_list_Agr.GetNextItem(-1, LVNI_SELECTED); if (iItem >= 0) { CRect rect; int offset = 0; // Make sure that the item is visible m_list_Agr.GetSubItemRect(iItem, 1, LVIR_BOUNDS, rect); // Now scroll if we need to expose the column CRect rcClient; m_list_leaseabs.GetClientRect(rcClient); if( offset + rect.left < 0 || offset + rect.left > rcClient.right ) { CSize size; size.cx = rect.left; size.cy = 0; m_list_leaseabs.Scroll(size); rect.left -= size.cx; } rect.left += offset; rect.right = rect.left + m_list_Agr.GetColumnWidth(1); if(rect.right > rcClient.right) rect.right = rcClient.right; //basic code end rect.NormalizeRect(); rect.bottom += 10 * rect.Height();//dropdown area "PLEASE SEE THIS" rect.left += 10; rect.right += 10; rect.top += 30; CStringList lstItems; lstItems.AddTail("X"); lstItems.AddTail("Y"); lstItems.AddTail("Z"); CComboBox *pADFList = new CComboInListView(iItem, 1, &lstItems); DWORD dwStyle = WS_CHILD | WS_VISIBLE | WS_VSCROLL | WS_HSCROLL|CBS_DROPDOWNLIST | CBS_DISABLENOSCROLL; pADFList->Create(dwStyle, rect, this, IDC_COMBOBOXINLISTVIEW); pADFList->ModifyStyleEx(0,WS_EX_CLIENTEDGE);//can we tell at all pADFList->SetHorizontalExtent(m_list_Agr.GetColumnWidth(1)); pADFList->ShowDropDown(); pADFList->SelectString(-1, m_list_Agr.GetItemText(iItem, 1)); } }

    K 1 Reply Last reply
    0
    • B BiswaR

      Hi Guys, I have a list control containing 3 columns, When i click on any item in the list box it again pops up a combo box. But problem is that when i am tring to increase the height of the combo box it's not increasing and reamain same always. I am giving you the whole code. please tell me how to fix this problem. I am trying to increase the rect.bottom but its not increasing. void CListAgr::OnListLButton(WPARAM wParam, LPARAM lParam) { UINT nFlags = lParam; int iItem = wParam; int iItem = m_list_Agr.GetNextItem(-1, LVNI_SELECTED); if (iItem >= 0) { CRect rect; int offset = 0; // Make sure that the item is visible m_list_Agr.GetSubItemRect(iItem, 1, LVIR_BOUNDS, rect); // Now scroll if we need to expose the column CRect rcClient; m_list_leaseabs.GetClientRect(rcClient); if( offset + rect.left < 0 || offset + rect.left > rcClient.right ) { CSize size; size.cx = rect.left; size.cy = 0; m_list_leaseabs.Scroll(size); rect.left -= size.cx; } rect.left += offset; rect.right = rect.left + m_list_Agr.GetColumnWidth(1); if(rect.right > rcClient.right) rect.right = rcClient.right; //basic code end rect.NormalizeRect(); rect.bottom += 10 * rect.Height();//dropdown area "PLEASE SEE THIS" rect.left += 10; rect.right += 10; rect.top += 30; CStringList lstItems; lstItems.AddTail("X"); lstItems.AddTail("Y"); lstItems.AddTail("Z"); CComboBox *pADFList = new CComboInListView(iItem, 1, &lstItems); DWORD dwStyle = WS_CHILD | WS_VISIBLE | WS_VSCROLL | WS_HSCROLL|CBS_DROPDOWNLIST | CBS_DISABLENOSCROLL; pADFList->Create(dwStyle, rect, this, IDC_COMBOBOXINLISTVIEW); pADFList->ModifyStyleEx(0,WS_EX_CLIENTEDGE);//can we tell at all pADFList->SetHorizontalExtent(m_list_Agr.GetColumnWidth(1)); pADFList->ShowDropDown(); pADFList->SelectString(-1, m_list_Agr.GetItemText(iItem, 1)); } }

      K Offline
      K Offline
      khan
      wrote on last edited by
      #2

      I could not check all of your code, but you can try this: Remove the CBS_DISABLENOSCROLL style from the Combobox. See if that helps. this is this.

      B 1 Reply Last reply
      0
      • K khan

        I could not check all of your code, but you can try this: Remove the CBS_DISABLENOSCROLL style from the Combobox. See if that helps. this is this.

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

        No it's not working. As per MSDN CBS_DISABLENOSCROLL: The list box shows a disabled vertical scroll bar when the list box does not contain enough items to scroll. Without this style, the scroll bar is hidden when the list box does not contain enough items. If possible then check the code we are missing fundamental concept like it's mapping mode or something.

        K 1 Reply Last reply
        0
        • B BiswaR

          No it's not working. As per MSDN CBS_DISABLENOSCROLL: The list box shows a disabled vertical scroll bar when the list box does not contain enough items to scroll. Without this style, the scroll bar is hidden when the list box does not contain enough items. If possible then check the code we are missing fundamental concept like it's mapping mode or something.

          K Offline
          K Offline
          khan
          wrote on last edited by
          #4

          Ok, I found the control you are using: http://www.codeguru.com/cpp/controls/listview/miscellanious/article.php/c1005/[^] Well, I don't really know what you want to do with it, but removing the CBS_DISABLENOSCROLL style causes it to drop lower. Maybe you want the scrollbars also. Well, I can't say more about it. I hope someone else can help you. this is this.

          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