Hello i am facing a System.OutOfMemoryException in VB.NET but i cannot understand why. I am just trying to do Me.BackgroundImageLayout = ImageLayout.Tile
. I don't think this can cause a exception, but it does. Please help me. I have searched across the internet but i didn't find anything about. Thanks in advance.
System.OutOfMemoryException
HResult=0x8007000E
Messaggio=Memoria insufficiente. ' Message=Insufficent Memory
Origine=System.Drawing ' Origin=System.Drawing
Analisi dello stack: ' Stack Analysis
in System.Drawing.TextureBrush..ctor(Image image, WrapMode wrapMode)
in System.Windows.Forms.ControlPaint.DrawBackgroundImage(Graphics g, Image backgroundImage, Color backColor, ImageLayout backgroundImageLayout, Rectangle bounds, Rectangle clipRect, Point scrollOffset, RightToLeft rightToLeft)
in System.Windows.Forms.Control.PaintBackground(PaintEventArgs e, Rectangle rectangle, Color backColor, Point scrollOffset)
in System.Windows.Forms.Control.PaintBackground(PaintEventArgs e, Rectangle rectangle)
in System.Windows.Forms.Control.OnPaintBackground(PaintEventArgs pevent)
in System.Windows.Forms.ScrollableControl.OnPaintBackground(PaintEventArgs e)
in System.Windows.Forms.Control.PaintWithErrorHandling(PaintEventArgs e, Int16 layer)
in System.Windows.Forms.Control.WmEraseBkgnd(Message& m)
in System.Windows.Forms.Control.WndProc(Message& m)
in System.Windows.Forms.ScrollableControl.WndProc(Message& m)
in System.Windows.Forms.Form.WndProc(Message& m)
in System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
in System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
in System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
Oh, this is the code that causes this:
Private Sub AffiancaToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles AffiancaToolStripMenuItem.Click
db.Tables("Settings").Rows(0).Item("layoutSfondo") = "Tile" ' i am writing to a xml file because i do not want to use the My.Settings
Me.BackgroundImageLayout = ImageLayout.Tile ' <--- this is the cause
End Sub
User contributions licensed under CC BY-SA 3.0