Freeze pane for a list box?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Riun
    New Member
    • Oct 2006
    • 34

    Freeze pane for a list box?

    Hi,

    I have a huge amount of columns in a list box, but I don't want a very wide list box. I need to see the first 3 columns constantly and want to scroll through the rest of the columns (like the freeze pane function in Excel). Please advice.
  • Rabbit
    Recognized Expert MVP
    • Jan 2007
    • 12517

    #2
    Listboxes don't come with this functionality. The best I can think of is to use custom navigation buttons that change the column widths.

    Comment

    • Riun
      New Member
      • Oct 2006
      • 34

      #3
      Thanks Rabbit. How can I go about doing that?

      Comment

      • Rabbit
        Recognized Expert MVP
        • Jan 2007
        • 12517

        #4
        Off the top of my head, the column width would be something like:
        1";1";1";0"; 1"

        Which would mean you would see the first 3 columns and the last column.
        Pressing the back button would run the following code:

        [Code=vb]
        Me.ListboxContr ol.ColumnWidth = Replace(Me.List boxControl.Colu mnWidth, "0"";1""", "1"";0""")
        [/Code]

        This is untested but in theory should change the column width setting to
        1";1";1";1"; 0"

        It would give the illusion of freezing the panes. Of course you'd have to put in a check so that it doesn't hide the first 3 columns.

        Comment

        Working...