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#
  4. Horizontal scrolling in list box

Horizontal scrolling in list box

Scheduled Pinned Locked Moved C#
csharphelpquestion
4 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.
  • R Offline
    R Offline
    Reza Shojaee
    wrote on last edited by
    #1

    Hi I have a list box in my program that insert some string into it with C# code. Sometimes length of string is more than width of list box, but horizontal scroll bar doesn't appear in list box. Do you know solution of my problem ?

    Best Regards, Reza Shojaee

    L OriginalGriffO 2 Replies Last reply
    0
    • R Reza Shojaee

      Hi I have a list box in my program that insert some string into it with C# code. Sometimes length of string is more than width of list box, but horizontal scroll bar doesn't appear in list box. Do you know solution of my problem ?

      Best Regards, Reza Shojaee

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      set the HorizontalScrollBar property of list is true

      If you can think then I Can.

      modified on Saturday, March 13, 2010 4:40 AM

      OriginalGriffO 1 Reply Last reply
      0
      • L Lost User

        set the HorizontalScrollBar property of list is true

        If you can think then I Can.

        modified on Saturday, March 13, 2010 4:40 AM

        OriginalGriffO Offline
        OriginalGriffO Offline
        OriginalGriff
        wrote on last edited by
        #3

        You could indeed put the ListBox into a panel with scroll bars on the panel, but unless you make the ListBox either arbitrarily wide, or monitor the length of your strings and modify the ListBox appropriately, you can still run into the problem the OP describes, as the panel will not create scroll bars based on the ListBox content. Try it - you will see what I mean! The simplest solution is to set ListBox.HorizontalScrollBar = true

        You should never use standby on an elephant. It always crashes when you lift the ears. - Mark Wallace C/C++ (I dont see a huge difference between them, and the 'benefits' of C++ are questionable, who needs inheritance when you have copy and paste) - fat_boy

        "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
        "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt

        1 Reply Last reply
        0
        • R Reza Shojaee

          Hi I have a list box in my program that insert some string into it with C# code. Sometimes length of string is more than width of list box, but horizontal scroll bar doesn't appear in list box. Do you know solution of my problem ?

          Best Regards, Reza Shojaee

          OriginalGriffO Offline
          OriginalGriffO Offline
          OriginalGriff
          wrote on last edited by
          #4

          The simplest solution is to set ListBox.HorizontalScrollBar = true

          You should never use standby on an elephant. It always crashes when you lift the ears. - Mark Wallace C/C++ (I dont see a huge difference between them, and the 'benefits' of C++ are questionable, who needs inheritance when you have copy and paste) - fat_boy

          "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
          "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt

          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