title: How to list class objects in listbox using C#?
body: <p>I have a custom class</p>
  
  <pre><code>class RouteStop
  {
      public int number;
      public string location;
      public string street;
      public string city;
      public string state;
      public string zip;
  
      public RouteStop(int INnumber, string INlocation, string INstreet, string INcity, string INstate, string INzip)
      {
          this.number = INnumber;
          this.location = INlocation;
          this.street = INstreet;
          this.city = INcity;
          this.state = INstate;
          this.zip = INzip;
      }
  }
  </code></pre>
  
  <p>Then I have a list where I store RouteStop items</p>
  
  <pre><code>private List&lt;RouteStop&gt; routeStops = new List&lt;RouteStop&gt;();
  </code></pre>
  
  <p>What I am trying to archive is to load all objects from list into a listbox.
  So far it does it's job but instead of actual address it just writes object name into a list such like shown below <img src="https://i.stack.imgur.com/OTAaq.png" alt="enter image description here"></p>
  
  <p>How can I make it shows let's say number + location + street + city instead of object name?</p>
  
  <p>Also in future I will need to add OnSelect event to open a new window to edit each object's data. How would I pass information about which item is selected?</p>
  
  <p><strong>Added:</strong>
  Thank you very much everyone. Each answer helped. So what I did so far is changed data source to the list, overwrote ToString method to display full address in list, added new item to RouteStop with unique id and set the DisplayMember to the uniqe id so I can access selected item in future by id as well.</p>
  
  <p>Thank you very much once again</p>