Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8462279
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T14:07:22+00:00 2026-06-10T14:07:22+00:00

I have a list of Strings, List<String> . I want to be able to

  • 0

I have a list of Strings, List<String>.

I want to be able to open a form, showing the contents of this list, and allow the user to add, edit, and remove items from the list during run time.

I’ve been looking at ListView, but it isn’t clicking for me. I’m not sure if that’s because it isn’t the right solution or that I don’t get it.

What is the proper solution for what I want to do?

Chuck

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T14:07:23+00:00Added an answer on June 10, 2026 at 2:07 pm

    You can use a list view and a context menu for your target:
    try this code:

        List<string> listofstring = new List<string>() {"A","B","C" };
        private void Form1_Load(object sender, EventArgs e)
        {
            FillLstView();
        }
    
        private void Additem_Click(object sender, EventArgs e)
        {
            listofstring.Add("New Item");
            FillLstView();
        }
    
        private void RemoveItem_Click(object sender, EventArgs e)
        {
            listofstring.RemoveAt(lstview.FocusedItem.Index);
            EditItem.Enabled = false;
            RemoveItem.Enabled = false;
            FillLstView();
        }
    
        private void lstview_SelectedIndexChanged(object sender, EventArgs e)
        {
                RemoveItem.Enabled = true;
                EditItem.Enabled = true;
        }
    
        private void EditItem_Click(object sender, EventArgs e)
        {
            string input = Microsoft.VisualBasic.Interaction.InputBox("Enter Edit", "Title", "Edited", 0, 0);
            if (input != "")
            {
                listofstring[lstview.FocusedItem.Index] = input;
                EditItem.Enabled = false;
                RemoveItem.Enabled = false;
                FillLstView();
            }
        }
    
        private void FillLstView()
        {
            lstview.Clear();
            foreach (var item in listofstring)
            {
                lstview.Items.Add(item);
            }
        }
    

    Result

    enter image description here

    Download Project

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a list of string values that I want add to a hashtable
I have an ordered list like this: var list = new List<String>(){aaa,aab,aac,baa,bab,bac}; I want
I have a list of strings. For each string in that list, I want
I have a list: List(Of String) I want to filter it with LINQ. I
Using bash, I have a list of strings that I want to use to
I have a list of string like: s = [(abc,bcd,cde),(123,3r4,32f)] Now I want to
AH! I have a list of strings... and i just want to remove an
I have a ListView which displays a list of string values. I want to
I have a Dictionary<string, List<Order>> and I want to have the list of keys
I have a method that returns a list of type string. I want to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.