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. how to attach horizontal scroll bar to combo box control

how to attach horizontal scroll bar to combo box control

Scheduled Pinned Locked Moved C / C++ / MFC
tutorial
2 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.
  • S Offline
    S Offline
    saksp
    wrote on last edited by
    #1

    I have inserted a combo-box control in my project. In that control vertical scroll bar is present. I want horizontal scroll bar also. how to attach horizontal scroll bar to control

    thanks

    N 1 Reply Last reply
    0
    • S saksp

      I have inserted a combo-box control in my project. In that control vertical scroll bar is present. I want horizontal scroll bar also. how to attach horizontal scroll bar to control

      thanks

      N Offline
      N Offline
      Nibu babu thomas
      wrote on last edited by
      #2

      saksp wrote:

      I have inserted a combo-box control in my project. In that control vertical scroll bar is present. I want horizontal scroll bar also. how to attach horizontal scroll bar to control

      First edit .rc file to add WS_HSCROLL to combo box style codes since dialog does not support this. Then use this function, I've for demo purpose given 600, you need to use GetTextExtent function to get the real extent, look up MSDN for SetHorizontalExtent sample code...

      void CDialoTestDlg::AddHScroll()
      {
      CComboBox* pCmb = (CComboBox*)GetDlgItem(IDC_COMBO_HORZ_EXTENT);
      ASSERT( pCmb );

      pCmb->SendMessage( CB_SETHORIZONTALEXTENT, 600, 0 );
      }

      Nibu babu thomas Microsoft MVP for VC++ Code must be written to be read, not by the compiler, but by another human being. Programming Blog: http://nibuthomas.wordpress.com

      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