title: SendKeys.Send NullReferenceException
body: <p>I am trying to send keys to a control on my form. But I am getting a NullReferenceException and I don't know why. The code is about as basic as it gets:</p>
  
  <pre><code>Private Sub Button19_Click(sender As System.Object, e As System.EventArgs) Handles Button19.Click
      DateTimePicker2.Focus() 'commenting out this line has no effect
      SendKeys.Send("{F4}") 'error thrown on this line
  End Sub
  </code></pre>
  
  <p>The error reported is <code>object reference not set to an instance of an object</code> but <code>Send</code> is a shared method so doesn't need an instance.</p>
  
  <p>Strangely if I ignore the error it works fine and F4 is passed to the control. I know there was an issue with sendkeys and UAC but I thought this had been solved (I am using 4.0 framework)</p>