title: ArgumentException - Invalid Parameter by a FolderBrowseDialog? (vb.net)
body: <p>I have a bigger project and a problem which i can' figure out in it:</p>
  
  <pre><code>  Do Until Directory.Exists(xmlpath)
              Dim opendir As New FolderBrowserDialog
              opendir.RootFolder = Environment.SpecialFolder.Desktop
              opendir.SelectedPath = "C:\"
              If (opendir.ShowDialog() = DialogResult.OK) Then
                  xmlpath = opendir.SelectedPath
              End If
              opendir.Dispose()
          Loop
  </code></pre>
  
  <p>So soon the programm comes to the Line "If (opendir.ShowDialog() = DialogResult.OK) Then" i get this error:</p>
  
  <blockquote>
    <p>System.ArgumentException wurde nicht behandelt.   HResult=-2147024809 
    Message=Ungültiger Parameter.   Source=System.Drawing   StackTrace:
           bei System.Drawing.Image.get_Flags()
           bei System.Windows.Forms.ControlP aint.IsImageTransparent(Image backgroundImage)
           bei System.Windows.Forms.Control.PaintBackground(PaintEventArgs e, Rectangle rectangle, Color backColor, Point scrollOffset)
           bei System.Windows.Forms.Control.PaintBackground(PaintEventArgs e, Rectangle rectangle)
           bei System.Windows.Forms.Control.OnPaintBackground(PaintEventArgs pevent)
           bei System.Windows.Forms.ScrollableControl.OnPaintBackground(PaintEventArgs
    e)
           bei System.Windows.Forms.Control.PaintWithErrorHandling(PaintEventArgs e,
    Int16 layer)
           bei System.Windows.Forms.Control.WmPaint(Message&amp; m)
           bei System.Windows.Forms.Control.WndProc(Message&amp; m)
           bei System.Windows.Forms.ScrollableControl.WndProc(Message&amp; m)
           bei System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message&amp; m)
           bei System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message&amp; m)
           bei System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)   InnerException:</p>
  </blockquote>
  
  <p>Please forgive me that a few parts are german but i really have no idea why that error even comes.</p>
  
  <p>Its a given that the framework uses the Drawing Class for Controls but why should it run on an error where it was working before?</p>
  
  <p>EDIT:
  15.08.2015</p>
  
  <p>Well, i have reason to update it - got the Dialog to show - pretty much just moved it to a different location to be called.</p>
  
  <p>The Problem is, that i still get the ArgumentException, but now for a line where i change the height of a groupbox control.</p>
  
  <p>It seems to be a rather random Exception?</p>