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 8335717
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T03:45:19+00:00 2026-06-09T03:45:19+00:00

I am having trouble sending a List<> to a textbox and i am not

  • 0

I am having trouble sending a List<> to a textbox and i am not sure what the trouble is. I have checked so the List actually has values in it and that it gets properly transfered from the class into this block.

The code:

  public void Listtest(List<string> m_customers)
    {
        lstRegistry.Items.Clear();


        for (int index = 0; index == m_customers.Count; index++)
        {
            lstRegistry.Items.Add(m_customers[index]);
        }
    }

The other class that is sending the List<>

     class CustomManager
{
    //private List<Customer> m_customers;
    List<string> m_customers = new List<string>();        

    public void CreateNewString(string adresslist, string emaillist, string phonelist, string namelist)
    {
        MainForm strIn = new MainForm();
        string newlist = string.Format("{0,-3} {1, -10} {2, -20} {3, -30}", namelist, phonelist, emaillist, adresslist);           
        m_customers.Add(newlist);  //líst is created.
        strIn.Listtest(m_customers);           
    }
}  

I just cant get it to work and I am really stuck. :/

Thanks for any and all help and ideas!!!

//Regards

  • 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-09T03:45:21+00:00Added an answer on June 9, 2026 at 3:45 am

    Change the loop condition to: index < m_customers.Count

    Edit
    Also you might want to create a class for this data:

    class Person
    {
        public string Name {get; set;}
        public string Address {get; set;}
        public string Email {get; set;}
    }
    

    So you can make a list of Persons: List<Person>

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

Sidebar

Related Questions

Having some trouble sending properly formatted HTML e-mail from a PHP script. I am
I'm having trouble getting a UIWebView to load a URL that I'm sending to
I'm having trouble sending mail using SMTP from a Rails app. I have a
I am having trouble sending data to the database. The values are being sent,
I am having trouble sending JSON to a WebMethod. Here is the way that
I'm having a trouble with sending complex structure. I have two classes. I send
Hi I'm having trouble sending html form array to JS. I have dynamic html
I am having some trouble sending values from one page to another using the
I'm having trouble sending an UIImage object to my REST web service that only
I was having trouble sending up a url containing accent characters using IE. Here's

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.