title: User Interface disappearing with error : out of memory
body: <p>I have a problem which is that after leaving the program for a certain period let's say for 5 minutes or more the user interface starts to disappear, such as: buttons, labels ... etc</p>
  
  <p>Then if I try to click on anything It shows me an error as follows: <code>out of memory</code></p>
  
  <p>I use custom controls which are: Bunifu_UI_v1.5.3</p>
  
  <p>But I use simple things like datagridview and datetimepicker</p>
  
  <p>But I do not think the problem from it  because almost everything i use is the orginal controls  by the original visual studio.</p>
  
  <p>There is lots of code like this:</p>
  
  <pre><code>Private Sub close_butt_MouseEnter(sender As Object, e As EventArgs) Handles close_butt.MouseEnter
      close_butt.Image = My.Resources.Close_white_32
      close_butt.BackColor = Color.Red
  End Sub
  Private Sub close_butt_MouseLeave(sender As Object, e As EventArgs) Handles close_butt.MouseLeave
      close_butt.Image = My.Resources.Close_white_32
      close_butt.BackColor = Nothing
  End Sub
  </code></pre>
  
  <p>this is the error :</p>
  
  <p><a href="https://i.stack.imgur.com/34q3O.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/34q3O.png" alt="enter image description here"></a></p>
  
  <p>and this is the full error text :</p>
  
  <pre><code>System.OutOfMemoryException was unhandled
  HResult=-2147024882
  Message=Out of memory.
  StackTrace:
     at System.Drawing.Graphics.FromHdcInternal(IntPtr hdc)
     at System.Windows.Forms.ComboBox.WmReflectDrawItem(Message&amp; m)
     at System.Windows.Forms.ComboBox.WndProc(Message&amp; m)
     at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message&amp; m)
     at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message&amp; m)
     at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
     at System.Windows.Forms.UnsafeNativeMethods.SendMessage(HandleRef hWnd, Int32 msg, IntPtr wParam, IntPtr lParam)
     at System.Windows.Forms.Control.SendMessage(Int32 msg, IntPtr wparam, IntPtr lparam)
     at System.Windows.Forms.Control.ReflectMessageInternal(IntPtr hWnd, Message&amp; m)
     at System.Windows.Forms.Control.WmOwnerDraw(Message&amp; m)
     at System.Windows.Forms.Control.WmDrawItem(Message&amp; m)
     at System.Windows.Forms.Control.WndProc(Message&amp; m)
     at System.Windows.Forms.ScrollableControl.WndProc(Message&amp; m)
     at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message&amp; m)
     at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message&amp; m)
     at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
     at System.Windows.Forms.UnsafeNativeMethods.CallWindowProc(IntPtr wndProc, IntPtr hWnd, Int32 msg, IntPtr wParam, IntPtr lParam)
     at System.Windows.Forms.NativeWindow.DefWndProc(Message&amp; m)
     at System.Windows.Forms.Control.DefWndProc(Message&amp; m)
     at System.Windows.Forms.Control.WmSetFocus(Message&amp; m)
     at System.Windows.Forms.Control.WndProc(Message&amp; m)
     at System.Windows.Forms.ComboBox.WndProc(Message&amp; m)
     at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message&amp; m)
     at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message&amp; m)
     at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
     InnerException: 
  </code></pre>