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. VERTICAL SCROLL is visible or available

VERTICAL SCROLL is visible or available

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

    have the scroll property checked for both vertical and horizontal scrollbar. scenario 1: 1) you have Clist box 2) Add few entry to listbox till the vertical scroll bar appears 3) is there any way to find at this point that scrollbar has appeared. so that i may do some action based on that. Query : Any point of time given a LISBOX is it possible to find where VERTICAL SCROLL is visible or available for thendral

    N 1 Reply Last reply
    0
    • K Killer3

      have the scroll property checked for both vertical and horizontal scrollbar. scenario 1: 1) you have Clist box 2) Add few entry to listbox till the vertical scroll bar appears 3) is there any way to find at this point that scrollbar has appeared. so that i may do some action based on that. Query : Any point of time given a LISBOX is it possible to find where VERTICAL SCROLL is visible or available for thendral

      N Offline
      N Offline
      Naveen
      wrote on last edited by
      #2

      I think u didn't understand what i said try this..this will add the string to list box untill the scroll bar comes.. for( int nIdx =0; WS_VSCROLL != (m_ListEx.GetStyle()&WS_VSCROLL);nIdx++) { m_ListEx.AddString( _T("hi")); } // Vericall scroll bar appeared. // One item will be exceeding the limit..So delete that one.. m_ListEx.DeleteString( m_ListEx.GetCount() - 1 ); nave

      S 1 Reply Last reply
      0
      • N Naveen

        I think u didn't understand what i said try this..this will add the string to list box untill the scroll bar comes.. for( int nIdx =0; WS_VSCROLL != (m_ListEx.GetStyle()&WS_VSCROLL);nIdx++) { m_ListEx.AddString( _T("hi")); } // Vericall scroll bar appeared. // One item will be exceeding the limit..So delete that one.. m_ListEx.DeleteString( m_ListEx.GetCount() - 1 ); nave

        S Offline
        S Offline
        SimonSays
        wrote on last edited by
        #3

        Well, this is how I would do it: CRect clRect; m_ListEx.GetClientRect(clRect); int visibleCount = clRect.Height() / m_ListEx.GetItemHeight(0); while (m_ListEx.GetCount() < visibleCount) { m_ListEx.AddString (_T("Hi")); } Ok, it is a bit of a hack, but given the tools you get in CListBox, this is the best I could come up with.

        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