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. Problem With ListBox Horizontal Scrollbar

Problem With ListBox Horizontal Scrollbar

Scheduled Pinned Locked Moved C#
helpgraphics
3 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.
  • A Offline
    A Offline
    Aslam Bari
    wrote on last edited by
    #1

    Dear all, I have add a listbox with following property on listbox1.DrawMode=OwnerDrawVariable; listbox1.HorizontalScrollbar=true; listbox1.ScrollAlwaysVisible=true; I am overriding the DrawItem event of the ListBox for drawing item's text. Some text are too big to fit in the list box. But the Horizontal Scrollbar is not enabled or working. Horizontal scrollbar is visible and [disable or dim]. Vertical scrollbar is working fine. Please help.

    N A 2 Replies Last reply
    0
    • A Aslam Bari

      Dear all, I have add a listbox with following property on listbox1.DrawMode=OwnerDrawVariable; listbox1.HorizontalScrollbar=true; listbox1.ScrollAlwaysVisible=true; I am overriding the DrawItem event of the ListBox for drawing item's text. Some text are too big to fit in the list box. But the Horizontal Scrollbar is not enabled or working. Horizontal scrollbar is visible and [disable or dim]. Vertical scrollbar is working fine. Please help.

      N Offline
      N Offline
      Nader Elshehabi
      wrote on last edited by
      #2

      Hello Listboxes implement auto horizontal scroll by default. Why do you do all this?? Once you input an item that has a long enough text, the horizontal scrollbar should appear with the proper size!! If you want to set this manually -for one reason or the other- don't forget to set ListBox.HorizontalExtent to the right size.

      Regards:rose:

      1 Reply Last reply
      0
      • A Aslam Bari

        Dear all, I have add a listbox with following property on listbox1.DrawMode=OwnerDrawVariable; listbox1.HorizontalScrollbar=true; listbox1.ScrollAlwaysVisible=true; I am overriding the DrawItem event of the ListBox for drawing item's text. Some text are too big to fit in the list box. But the Horizontal Scrollbar is not enabled or working. Horizontal scrollbar is visible and [disable or dim]. Vertical scrollbar is working fine. Please help.

        A Offline
        A Offline
        Aslam Bari
        wrote on last edited by
        #3

        Thanks Nader, My Problem has resolved. I was not using HorizontalExtent. Now i realize this is important property. So very very thanks. Now I have a samll question too. What is the easiest way to give a shortcut key to a Button in C#. Like Ctrl+S or F6 etc. Thanks...

        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