title: String to event
body: <p>I'm trying to programmatically call a function with event.</p>
  
  <p>How to convert string to a event in general? My problem is actually not knowing How to do this?</p>
  
  <p>How to convert str to event?</p>
  
  <pre><code>str = "test1";
  
  // UserControlsBackgroundEventArgs = EventArgs 
  EventArgs arg = (EventArgs)str; --&gt; ?
  UserControlsBackgroundOutput(str); 
  
  
  
  //function 
  private string CLICKNAME = "test0";
  private void UserControlsBackgroundOutput(EventArgs e)
  {    
      if (CLICKNAME == e.output)
          return;
  
      if (e.output == "test1"){}
  }
  </code></pre>
  
  <p><strong>Error solved:</strong>
  I had to do</p>
  
  <pre><code>UserControlsBackgroundEventArgs arg = new UserControlsBackgroundEventArgs(CLICKNAME);
  </code></pre>
  
  <p>instead of</p>
  
  <pre><code>UserControlsBackgroundEventArgs arg = new (UserControlsBackgroundEventArgs)(CLICKNAME);
  </code></pre>