Results 1 to 4 of 4

Thread: ListBox.Items.add; how to add at the top?

  1. #1
    Budius is offline VB.NET Forum Fanatic
    .NET Framework
    .NET 3.5
    Join Date
    Aug 2010
    Location
    UK
    Posts
    137
    Reputation
    109

    ListBox.Items.add; how to add at the top?

    I remember in the old VB6 that there was something simple as listbox.add("my string", 1)
    This '1' would meant the position I want it to be added, which means 'the top' ...

    I'm sure it sounds newbie... but hey, what a heck... I'm only been programming .net for a few months.

    Any one ???
    Last edited by Budius; 08-16-2010 at 5:19 AM. Reason: Resolved

  2. #2
    kulrom's Avatar
    kulrom is offline VB.NET Forum All-Mighty
    .NET Framework
    .NET 3.5
    Join Date
    May 2005
    Location
    Republic of Macedonia
    Posts
    2,855
    Reputation
    266
    ListBox1.Items.Insert(0, "Very first item")

  3. #3
    JohnH's Avatar
    JohnH is offline VB.NET Forum Moderator
    .NET Framework
    .NET 4.0
    Join Date
    Dec 2005
    Location
    Norway
    Posts
    14,587
    Reputation
    2737

  4. #4
    Budius is offline VB.NET Forum Fanatic
    .NET Framework
    .NET 3.5
    Join Date
    Aug 2010
    Location
    UK
    Posts
    137
    Reputation
    109
    because of the previous use of Add, I didn't realise the 'insert' would be a valid option.
    thank you guys.

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Harvest time tracking