title: Getting a stack overflow exception when calling OpenFileDialog1.ShowDialog()
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/8428574/attempted-to-read-or-write-protected-memory-when-i-call-showdialog-method-of-op">Attempted to read or write protected memory. When I call showDialog method of openfileDialog</a>  </p>
  </blockquote>
  
  
  
  <p>Not sure why. It was originally working just fine, then I made some changes to the code that should have had no effect on this. </p>
  
  <p>The changes I made where to just change some properties of a checkbox when the file is selected:</p>
  
  <pre><code>Private Sub OpenFileDialog1_FileOk(ByVal sender As System.Object, ByVal e As System.ComponentModel.CancelEventArgs)
      attachmentLabel.Text = OpenFileDialog1.FileName.ToString()
      attachmentCheckBox.Visible = True
      attachmentCheckBox.Checked = True
  End Sub
  </code></pre>
  
  <p>Here's the event handler that calls OpenFileDialog1.ShowDialog() </p>
  
  <pre><code>Private Sub Button2_Click(sender As System.Object, e As System.EventArgs) Handles Button2.Click
  
          OpenFileDialog1.Title = "Please Select a File"
          OpenFileDialog1.InitialDirectory = "C:temp"
  
          OpenFileDialog1.ShowDialog()
  
  
      End Sub
  </code></pre>
  
  <p>Any help would be appreciated. 
  When the exception occurs, the values for e and sender say "unable to evaluate expression".</p>