10/09/09 9:48
__BlackworM__
Aiuto sto impazzendo !
Ho creato un semplice form di accesso ma quando lo eseguo mi da un errore di memoria insufficiente !
QUESTO IL REPORT:
questo e' il codice del form molto molto semplice ma va ad aprire altri form leggermente più complessi...
come risolvo ?
oppure se dovrei liberare memoria al caricamento ?
Ho creato un semplice form di accesso ma quando lo eseguo mi da un errore di memoria insufficiente !
QUESTO IL REPORT:
System.OutOfMemoryException non è stata gestita Message="Memoria insufficiente." Source="System.Drawing" StackTrace: in System.Drawing.Graphics.FromHdcInternal(IntPtr hdc) in System.Windows.Forms.PaintEventArgs.get_Graphics() in System.Windows.Forms.Control.PaintBackColor(PaintEventArgs e, Rectangle rectangle, Color backColor) 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, Boolean disposeEventArgs) 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.ContainerControl.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) in System.Windows.Forms.UnsafeNativeMethods.PeekMessage(MSG& msg, HandleRef hwnd, Int32 msgMin, Int32 msgMax, Int32 remove) in System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData) in System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context) in System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context) in System.Windows.Forms.Application.Run(ApplicationContext context) in Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun() in Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel() in Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[] commandLine) in GFS_Communication_Generale.My.MyApplication.Main(String[] Args) in 17d14f5c-a337-4978-8281-53493378c1071.vb:riga 81 in System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args) in System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args) in Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly() in System.Threading.ThreadHelper.ThreadStart_Context(Object state) in System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) in System.Threading.ThreadHelper.ThreadStart() InnerException:
questo e' il codice del form molto molto semplice ma va ad aprire altri form leggermente più complessi...
come risolvo ?
oppure se dovrei liberare memoria al caricamento ?
Private Sub OK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OK.Click 'Se è un agente If txtUser.Text = "agente" And txtPass.Text = "agente" Then Me.Hide() frmAgenti.ShowDialog() Me.Close() 'Se è un addetto al call center ElseIf txtUser.Text = "callcenter" And txtPass.Text = "callcenter" Then Me.Hide() frmTelemarketing.ShowDialog() Me.Close() ' Se è l'amministratore ElseIf txtUser.Text = "admin" And txtPass.Text = "admin" Then Me.Hide() frmAdmin.ShowDialog() Me.Close() Else 'Login errato MsgBox("Attenzione Username o Password Errati !", MsgBoxStyle.Exclamation) Exit Sub End If End Sub Private Sub Cancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Cancel.Click Me.Close() End Sub
aaa