是否可以在VB ListBox中使用MultipleColumn

我无法在ListBox中使用MultipleColumns。我已经将ListBox1.MultiColumn属性设置为true。 ListBox1.ColumnCount说ColumnCount不是ListBox的成员

评论
  • ksit
    ksit 回复

    Please notice that a Multi-Column ListBox does NOT mean that you can add several columns (such as a datagridview). When you set ListBox1.MultiColumn = True it only means that ListBox1 places items into as many columns as are needed to make vertical scrolling unnecessary. You can test it by decreasing the height of ListBox1 and then adding many items. You will see something like this: Multi-Column ListBox

    As you can see, ListBox1 automatically puts items in multi columns and there is no Vertical scrollbar. For more information, you can see ListBox.MultiColumn Property from Microsoft documents.