title: Refresh Listbox from another Form
body: <p>This is the program I have:</p>
  
  <p><img src="https://i.stack.imgur.com/Huf2b.png" alt="enter image description here"></p>
  
  <p>What I am trying to achieve is that once I click "Add Event", then the listbox of events is refreshed (as you can see, it is in the main form). Normally when the main form loads the list is refreshed (loaded from .txt file) and I have a method for it in separate class (C)..</p>
  
  <pre><code>    public static void DisplayOnlyEvents(ListBox lstOutput)
      {
          //clear listbox first            
          lstOutput.Items.Clear();
          string output;
  
          //output data 
          foreach (Event Event in frmMainWindow.AllExistingEvents)
          {
                      output = (Event.getDescription());
                      lstOutput.Items.Add(output);
  
  
          }
      }
  </code></pre>
  
  <p>Clearly this method requires passing a listbox from main from into it, in order for it to work. But how can I pass a listbox that is in form A from form B into a method that is in class C?</p>
  
  <p>If you need more information, please ask. Any help would be appreciated.</p>