title: Update Value of the NumericUpDown control without raising of ValueChanged event (Winforms)
body: <p>I need to update a Value of the NumericUpDown control without raising of ValueChanged event (WinForms, C#).<br>
  The simple way is to remove event handler like:</p>
  
  <pre><code>numericUpDown.ValueChanged -= numericUpDown_ValueChanged;
  </code></pre>
  
  <p>After that to set the needed value:</p>
  
  <pre><code>numericUpDown.Value = 15;
  </code></pre>
  
  <p>And to add the event handler again:</p>
  
  <pre><code>numericUpDown.ValueChanged += numericUpDown_ValueChanged;
  </code></pre>
  
  <p>The problem is that I want to write method that will get the NumericUpDown control as a first parameter, needed value as a second parameter and will update the value in the way that was given below.<br>
  To do it, I need to find the connected event handler for the ValueChanged event (for each NumericUpDown it's different).<br>
  I searched a lot, but didn't find the solution that would work for me.<br>
  My last try was:</p>
  
  <pre><code>private void NumericUpDownSetValueWithoutValueChangedEvent(NumericUpDown control, decimal value)
  {
      EventHandlerList events = (EventHandlerList)typeof(Component).GetField("events", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.GetField).GetValue(control);
      object current = events.GetType().GetFields(BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.GetField)[0].GetValue(events);
      List&lt;Delegate&gt; delegates = new List&lt;Delegate&gt;();
      while (current != null)
      {
           delegates.Add((Delegate)GetField(current, "handler"));
           current = GetField(current, "next");
      }
      foreach (Delegate d in delegates)
      {
           Debug.WriteLine(d.ToString());
      }
  }
  public static object GetField(object listItem, string fieldName)
  {
      return listItem.GetType().GetField(fieldName, BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.GetField).GetValue(listItem);
  }
  </code></pre>
  
  <p>After running of NumericUpDownSetValueWithoutValueChangedEvent function, the <code>object current</code> is equal to null, so no one EventHandler was not found (I tried it on the Form - all event handlers were found).  </p>