Results 1 to 5 of 5

Thread: listview limitation

  1. #1
    jhedonghae is offline VB.NET Forum Newbie
    .NET Framework
    .NET 3.5
    Join Date
    Mar 2012
    Posts
    17
    Reputation
    16

    listview limitation

    hi
    how do i set a listview to only add one item from a combobox?
    example: when the combobox contains the items dog,cat,pig and when the user chooses pig it is added to the listview but when the user selects the pig again it must prompt that already added...
    i have here a code for adding items in a listview:
    Dim lv As ListViewItem = ListView1.Items.Add(ComboBox7.Text)
    lv.SubItems.Add(ComboBox2.Text)
    lv.SubItems.Add(ComboBox4.Text)
    lv.SubItems.Add(ComboBox5.Text)
    lv.SubItems.Add(ComboBox6.Text)
    lv.SubItems.Add(TextBox2.Text)
    i will really appreciate anyones help

  2. #2
    JohnH's Avatar
    JohnH is offline VB.NET Forum Moderator
    .NET Framework
    .NET 4.0
    Join Date
    Dec 2005
    Location
    Norway
    Posts
    14,186
    Reputation
    2368
    Maybe you should remove the option once user has selected it, since it can't be selected again?

  3. #3
    jhedonghae is offline VB.NET Forum Newbie
    .NET Framework
    .NET 3.5
    Join Date
    Mar 2012
    Posts
    17
    Reputation
    16
    Quote Originally Posted by JohnH View Post
    Maybe you should remove the option once user has selected it, since it can't be selected again?

    how do i do that? how can i remove the option if it is already selected?

  4. #4
    jhedonghae is offline VB.NET Forum Newbie
    .NET Framework
    .NET 3.5
    Join Date
    Mar 2012
    Posts
    17
    Reputation
    16
    Quote Originally Posted by JohnH View Post
    Maybe you should remove the option once user has selected it, since it can't be selected again?
    well i tried your suggestion and it works but i'm encountering another problem

  5. #5
    JohnH's Avatar
    JohnH is offline VB.NET Forum Moderator
    .NET Framework
    .NET 4.0
    Join Date
    Dec 2005
    Location
    Norway
    Posts
    14,186
    Reputation
    2368
    When you add to listview you can at the same time remove from combobox.

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