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. CListBox scroll bar not getting enabled

CListBox scroll bar not getting enabled

Scheduled Pinned Locked Moved C / C++ / MFC
helpquestion
8 Posts 3 Posters 1 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.
  • F Offline
    F Offline
    FASTian
    wrote on last edited by
    #1

    the vertical scroll bar doesnt get enabled if i add string which doesnt fit a list box. Any ideas what seems to be the problem here. Horizontal scroll bar seems to work fine. m_lstboxMessages.AddString(sServerMsg); UpdateData(FALSE); where m_lstboxMessages is control variable of CListBox Any suggestion regarding this??

    R D 2 Replies Last reply
    0
    • F FASTian

      the vertical scroll bar doesnt get enabled if i add string which doesnt fit a list box. Any ideas what seems to be the problem here. Horizontal scroll bar seems to work fine. m_lstboxMessages.AddString(sServerMsg); UpdateData(FALSE); where m_lstboxMessages is control variable of CListBox Any suggestion regarding this??

      R Offline
      R Offline
      RChin
      wrote on last edited by
      #2

      Make sure that the Vertical ScrollBar property of your control is enabled. You should be able to see this in the resource view.


      I Dream of Absolute Zero

      F 1 Reply Last reply
      0
      • R RChin

        Make sure that the Vertical ScrollBar property of your control is enabled. You should be able to see this in the resource view.


        I Dream of Absolute Zero

        F Offline
        F Offline
        FASTian
        wrote on last edited by
        #3

        yea its enabled infact i should have mentioned the styles that i have turned on... Border=checked Horizontal Scroll=checked Vertical scroll=checked Disable No Scroll=checked No integral height=checked any thing missing over here??

        1 Reply Last reply
        0
        • F FASTian

          the vertical scroll bar doesnt get enabled if i add string which doesnt fit a list box. Any ideas what seems to be the problem here. Horizontal scroll bar seems to work fine. m_lstboxMessages.AddString(sServerMsg); UpdateData(FALSE); where m_lstboxMessages is control variable of CListBox Any suggestion regarding this??

          D Offline
          D Offline
          David Crow
          wrote on last edited by
          #4

          FASTian wrote: the vertical scroll bar doesnt get enabled if i add string which doesnt fit a list box. This indicates that the horizontal scroll bar is not working. The vertical scroll bar is not concerned with a string's length. It comes into play when there are more items in the control than can be displayed (e.g., the control can only show 10 strings but 15 have been added). If I am correct, it sounds like you simply need to call SetHorizontalExtent() in the dialog's OnInitDialog() method.. FASTian wrote: m_lstboxMessages.AddString(sServerMsg); UpdateData(FALSE); There is no need to (ever) call UpdataData().


          "The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)

          F 1 Reply Last reply
          0
          • D David Crow

            FASTian wrote: the vertical scroll bar doesnt get enabled if i add string which doesnt fit a list box. This indicates that the horizontal scroll bar is not working. The vertical scroll bar is not concerned with a string's length. It comes into play when there are more items in the control than can be displayed (e.g., the control can only show 10 strings but 15 have been added). If I am correct, it sounds like you simply need to call SetHorizontalExtent() in the dialog's OnInitDialog() method.. FASTian wrote: m_lstboxMessages.AddString(sServerMsg); UpdateData(FALSE); There is no need to (ever) call UpdataData().


            "The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)

            F Offline
            F Offline
            FASTian
            wrote on last edited by
            #5

            nopes thats not the case the horizontal bar shows correctly... when i add a long string. It only shows a part of the string according to the vertical height i.e it just shows only the last 10 characters or something like that...

            D 1 Reply Last reply
            0
            • F FASTian

              nopes thats not the case the horizontal bar shows correctly... when i add a long string. It only shows a part of the string according to the vertical height i.e it just shows only the last 10 characters or something like that...

              D Offline
              D Offline
              David Crow
              wrote on last edited by
              #6

              I think I understand, but a picture is worth 1,000 words. Can you provide one?


              "The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)

              F 1 Reply Last reply
              0
              • D David Crow

                I think I understand, but a picture is worth 1,000 words. Can you provide one?


                "The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)

                F Offline
                F Offline
                FASTian
                wrote on last edited by
                #7

                any ideas how i can paste a pic over here??? :)

                D 1 Reply Last reply
                0
                • F FASTian

                  any ideas how i can paste a pic over here??? :)

                  D Offline
                  D Offline
                  David Crow
                  wrote on last edited by
                  #8

                  You can't (that I know of). You'd need to upload one to your own Web site and provide a link for it here.


                  "The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)

                  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