Multicolumn Listbox

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • WRH

    Multicolumn Listbox

    Hello
    I want to have a multicolumn listbox. I never used one before
    so I looked at a Help example. I set the multicolumn property and
    the column width and tested with this example...

    this.listBox3.I tems.AddRange(n ew object[]
    {
    "Item 1, column 1",
    "Item 2, column 1",
    "Item 3, column 1",
    "Item 4, column 1",
    "Item 5, column 1",
    "Item 1, column 2",
    "Item 2, column 2",
    "Item 3, column 2" });

    It works perfectly, with column 1 items is column one and column 2
    items in column 2. Now here's why I posted...I don't understand the
    example! What is there that results in a two column list with 5 lines
    in column 1 and 3 lines in column 2?




  • Ignacio Machin \( .NET/ C# MVP \)

    #2
    Re: Multicolumn Listbox

    Hi,

    Each object is a comma separated list of values so I assume that the listbox
    expect that you define the columns that way.

    You failed to mention if this is a web or a win example ( I assume that a
    window)

    --
    Ignacio Machin
    The #1 Warehouse Management System & Direct Store Delivery Software (DSD) for QuickBooks & ERP Systems – LaceUp Solutions

    Mobile & warehouse Solutions.
    "WRH" <nospam@videotr on.cawrote in message
    news:%23SQ4WdLF IHA.4476@TK2MSF TNGP06.phx.gbl. ..
    Hello
    I want to have a multicolumn listbox. I never used one before
    so I looked at a Help example. I set the multicolumn property and
    the column width and tested with this example...
    >
    this.listBox3.I tems.AddRange(n ew object[]
    {
    "Item 1, column 1",
    "Item 2, column 1",
    "Item 3, column 1",
    "Item 4, column 1",
    "Item 5, column 1",
    "Item 1, column 2",
    "Item 2, column 2",
    "Item 3, column 2" });
    >
    It works perfectly, with column 1 items is column one and column 2
    items in column 2. Now here's why I posted...I don't understand the
    example! What is there that results in a two column list with 5 lines
    in column 1 and 3 lines in column 2?
    >
    >
    >
    >

    Comment

    • WRH

      #3
      Re: Multicolumn Listbox

      Thanks for the quick reply.
      Further testing shows that the last 3 items went into column 2 only
      because of the height of the listBox (No vertical scroll) What I want
      is to specify the column for an item.

      Using windows forms, MS VC# 2005 express edition


      "Ignacio Machin ( .NET/ C# MVP )" <machin TA laceupsolutions .comwrote in
      message news:%23buTgqLF IHA.3980@TK2MSF TNGP03.phx.gbl. ..
      Hi,
      >
      Each object is a comma separated list of values so I assume that the
      listbox expect that you define the columns that way.
      >
      You failed to mention if this is a web or a win example ( I assume that a
      window)
      >
      --
      Ignacio Machin
      The #1 Warehouse Management System & Direct Store Delivery Software (DSD) for QuickBooks & ERP Systems – LaceUp Solutions

      Mobile & warehouse Solutions.
      "WRH" <nospam@videotr on.cawrote in message
      news:%23SQ4WdLF IHA.4476@TK2MSF TNGP06.phx.gbl. ..
      >Hello
      >I want to have a multicolumn listbox. I never used one before
      >so I looked at a Help example. I set the multicolumn property and
      >the column width and tested with this example...
      >>
      > this.listBox3.I tems.AddRange(n ew object[]
      > {
      > "Item 1, column 1",
      > "Item 2, column 1",
      > "Item 3, column 1",
      > "Item 4, column 1",
      > "Item 5, column 1",
      > "Item 1, column 2",
      > "Item 2, column 2",
      > "Item 3, column 2" });
      >>
      >It works perfectly, with column 1 items is column one and column 2
      >items in column 2. Now here's why I posted...I don't understand the
      >example! What is there that results in a two column list with 5 lines
      >in column 1 and 3 lines in column 2?
      >>
      >>
      >>
      >>
      >
      >

      Comment

      • Ignacio Machin \( .NET/ C# MVP \)

        #4
        Re: Multicolumn Listbox

        Hi,

        You have to read the docs and see what format ListBox expect for
        multicolumns lists.

        I just found the txt:
        A multicolumn ListBox places items into as many columns as are needed to
        make vertical scrolling unnecessary. The user can use the keyboard to
        navigate to columns that are not currently visible. Set the
        HorizontalScrol lbar property to true to display a horizontal scroll bar that
        enables the user to scroll to columns that are not currently shown in the
        visible region of the ListBox. The value of the ColumnWidth property
        determines the width of each column.



        --
        Ignacio Machin
        The #1 Warehouse Management System & Direct Store Delivery Software (DSD) for QuickBooks & ERP Systems – LaceUp Solutions

        Mobile & warehouse Solutions.
        "WRH" <nospam@videotr on.cawrote in message
        news:%23IaBT4LF IHA.4544@TK2MSF TNGP06.phx.gbl. ..
        Thanks for the quick reply.
        Further testing shows that the last 3 items went into column 2 only
        because of the height of the listBox (No vertical scroll) What I want
        is to specify the column for an item.
        >
        Using windows forms, MS VC# 2005 express edition
        >
        >
        "Ignacio Machin ( .NET/ C# MVP )" <machin TA laceupsolutions .comwrote in
        message news:%23buTgqLF IHA.3980@TK2MSF TNGP03.phx.gbl. ..
        >Hi,
        >>
        >Each object is a comma separated list of values so I assume that the
        >listbox expect that you define the columns that way.
        >>
        >You failed to mention if this is a web or a win example ( I assume that a
        >window)
        >>
        >--
        >Ignacio Machin
        >http://www.laceupsolutions.com
        >Mobile & warehouse Solutions.
        >"WRH" <nospam@videotr on.cawrote in message
        >news:%23SQ4WdL FIHA.4476@TK2MS FTNGP06.phx.gbl ...
        >>Hello
        >>I want to have a multicolumn listbox. I never used one before
        >>so I looked at a Help example. I set the multicolumn property and
        >>the column width and tested with this example...
        >>>
        >> this.listBox3.I tems.AddRange(n ew object[]
        >> {
        >> "Item 1, column 1",
        >> "Item 2, column 1",
        >> "Item 3, column 1",
        >> "Item 4, column 1",
        >> "Item 5, column 1",
        >> "Item 1, column 2",
        >> "Item 2, column 2",
        >> "Item 3, column 2" });
        >>>
        >>It works perfectly, with column 1 items is column one and column 2
        >>items in column 2. Now here's why I posted...I don't understand the
        >>example! What is there that results in a two column list with 5 lines
        >>in column 1 and 3 lines in column 2?
        >>>
        >>>
        >>>
        >>>
        >>
        >>
        >
        >

        Comment

        • WRH

          #5
          Re: Multicolumn Listbox

          Thanks again for the info.

          I have decided to use ListView instead, as it seems much
          more manageable with regard to columns.

          I could not be sure what the user may see at any given
          time with a multicolumn ListBox!

          "Ignacio Machin ( .NET/ C# MVP )" <machin TA laceupsolutions .comwrote in
          message news:u9oh%236MF IHA.1168@TK2MSF TNGP02.phx.gbl. ..
          Hi,
          >
          You have to read the docs and see what format ListBox expect for
          multicolumns lists.
          >
          I just found the txt:
          A multicolumn ListBox places items into as many columns as are needed to
          make vertical scrolling unnecessary. The user can use the keyboard to
          navigate to columns that are not currently visible. Set the
          HorizontalScrol lbar property to true to display a horizontal scroll bar
          that enables the user to scroll to columns that are not currently shown in
          the visible region of the ListBox. The value of the ColumnWidth property
          determines the width of each column.
          >
          >
          >
          --
          Ignacio Machin
          The #1 Warehouse Management System & Direct Store Delivery Software (DSD) for QuickBooks & ERP Systems – LaceUp Solutions

          Mobile & warehouse Solutions.
          "WRH" <nospam@videotr on.cawrote in message
          news:%23IaBT4LF IHA.4544@TK2MSF TNGP06.phx.gbl. ..
          >Thanks for the quick reply.
          >Further testing shows that the last 3 items went into column 2 only
          >because of the height of the listBox (No vertical scroll) What I want
          >is to specify the column for an item.
          >>
          >Using windows forms, MS VC# 2005 express edition
          >>
          >>
          >"Ignacio Machin ( .NET/ C# MVP )" <machin TA laceupsolutions .comwrote
          >in message news:%23buTgqLF IHA.3980@TK2MSF TNGP03.phx.gbl. ..
          >>Hi,
          >>>
          >>Each object is a comma separated list of values so I assume that the
          >>listbox expect that you define the columns that way.
          >>>
          >>You failed to mention if this is a web or a win example ( I assume that
          >>a window)
          >>>
          >>--
          >>Ignacio Machin
          >>http://www.laceupsolutions.com
          >>Mobile & warehouse Solutions.
          >>"WRH" <nospam@videotr on.cawrote in message
          >>news:%23SQ4Wd LFIHA.4476@TK2M SFTNGP06.phx.gb l...
          >>>Hello
          >>>I want to have a multicolumn listbox. I never used one before
          >>>so I looked at a Help example. I set the multicolumn property and
          >>>the column width and tested with this example...
          >>>>
          >>> this.listBox3.I tems.AddRange(n ew object[]
          >>> {
          >>> "Item 1, column 1",
          >>> "Item 2, column 1",
          >>> "Item 3, column 1",
          >>> "Item 4, column 1",
          >>> "Item 5, column 1",
          >>> "Item 1, column 2",
          >>> "Item 2, column 2",
          >>> "Item 3, column 2" });
          >>>>
          >>>It works perfectly, with column 1 items is column one and column 2
          >>>items in column 2. Now here's why I posted...I don't understand the
          >>>example! What is there that results in a two column list with 5 lines
          >>>in column 1 and 3 lines in column 2?
          >>>>
          >>>>
          >>>>
          >>>>
          >>>
          >>>
          >>
          >>
          >
          >

          Comment

          • Ignacio Machin \( .NET/ C# MVP \)

            #6
            Re: Multicolumn Listbox

            Hi,


            --
            Ignacio Machin
            The #1 Warehouse Management System & Direct Store Delivery Software (DSD) for QuickBooks & ERP Systems – LaceUp Solutions

            Mobile & warehouse Solutions.
            "WRH" <nospam@videotr on.cawrote in message
            news:%23qNL92OF IHA.1188@TK2MSF TNGP04.phx.gbl. ..
            Thanks again for the info.
            >
            I have decided to use ListView instead, as it seems much
            more manageable with regard to columns.
            >
            I could not be sure what the user may see at any given
            time with a multicolumn ListBox!
            Wise decision, Listview is the control for that.


            Comment

            Working...