Здравствуйте, я сталкиваюсь с System.OutOfMemoryException в VB.NET, но я не могу понять, почему.Я просто пытаюсь сделать Me.BackgroundImageLayout = ImageLayout.Tile
.Я не думаю, что это может вызвать исключение, но это так.Пожалуйста, помогите мне.Я искал в интернете, но ничего не нашел.Заранее спасибо.
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)
О, вот код, который вызывает это:
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