| | |
What's wrong with this code?
Please support our C# advertiser: Intel Parallel Studio Home
Thread Solved |
Is there anything wrong with this code?
Apart from the indentation?
When i run it ithe splash form doesn't close...Also, if i change to , i get this error:
System.ObjectDisposedException was unhandled
Message="Cannot access a disposed object.\r\nObject name: 'splash'."
Source="System.Windows.Forms"
ObjectName="splash"
StackTrace:
at System.Windows.Forms.Control.CreateHandle()
at System.Windows.Forms.Form.CreateHandle()
at System.Windows.Forms.Control.get_Handle()
at System.Windows.Forms.Control.SetVisibleCore(Boolean value)
at System.Windows.Forms.Form.SetVisibleCore(Boolean value)
at System.Windows.Forms.Control.set_Visible(Boolean value)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.Run(Form mainForm)
at RotnetSudoku.Program.Main() in D:\Documents and Settings\T\My Documents\Visual Studio 2005\Projects\RotnetSudoku\RotnetSudoku\Program.cs:line 17
at System.AppDomain.nExecuteAssembly(Assembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
:!:
:mad:
C# Syntax (Toggle Plain Text)
namespace RotnetSudoku { public partial class splash : Form { public splash() { InitializeComponent(); fclsStartScreen frmStartscreen = new fclsStartScreen(); frmStartscreen.Show(); this.Visible = false; } } }
When i run it ithe splash form doesn't close...Also, if i change
c# Syntax (Toggle Plain Text)
this.Visible= false;
c# Syntax (Toggle Plain Text)
this.close();
System.ObjectDisposedException was unhandled
Message="Cannot access a disposed object.\r\nObject name: 'splash'."
Source="System.Windows.Forms"
ObjectName="splash"
StackTrace:
at System.Windows.Forms.Control.CreateHandle()
at System.Windows.Forms.Form.CreateHandle()
at System.Windows.Forms.Control.get_Handle()
at System.Windows.Forms.Control.SetVisibleCore(Boolean value)
at System.Windows.Forms.Form.SetVisibleCore(Boolean value)
at System.Windows.Forms.Control.set_Visible(Boolean value)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.Run(Form mainForm)
at RotnetSudoku.Program.Main() in D:\Documents and Settings\T\My Documents\Visual Studio 2005\Projects\RotnetSudoku\RotnetSudoku\Program.cs:line 17
at System.AppDomain.nExecuteAssembly(Assembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
:!:
:mad: Last edited by scru; Mar 1st, 2007 at 7:07 pm.
To make it invisible use this code:
this.Hide();
BUT if you are hiding your main form, then you will have to use Application.Exit(); when you want to shut down the application. Otherwise it will still run and cause problems. If it's not the main form of your application (by that I mean Form1), then use this.Close(); to just simply get rid of the form.
Hope this helps
this.Hide();
BUT if you are hiding your main form, then you will have to use Application.Exit(); when you want to shut down the application. Otherwise it will still run and cause problems. If it's not the main form of your application (by that I mean Form1), then use this.Close(); to just simply get rid of the form.
Hope this helps
Last edited by RwCC; Mar 6th, 2007 at 8:28 am.
Sir David Healy - Northern Ireland Goal King
![]() |
Similar Threads
- Can anyone figure out what is wrong in my program? (C++)
- What did I do wrong? (C++)
- Need help! With changing an equation into code and file opening (C++)
- Please help with login page code behind (ASP.NET)
- please help me!!been trying to trace where ive gone wrong!!! (C)
- Script stores data in wrong MySQL columns (MySQL)
- wrong output (C++)
- What is wrong wtih my css? (JavaScript / DHTML / AJAX)
- merged:nesting loops (C++)
Other Threads in the C# Forum
- Previous Thread: To Moderators
- Next Thread: Open a file.
| Thread Tools | Search this Thread |
.net access algorithm array barchart bitmap box broadcast c# check checkbox client combobox control conversion csharp custom cyclethruopenforms data database datagrid datagridview dataset date/time datetime degrees development draganddrop drawing encryption enum event excel file filename finalyearproject form format forms function gdi+ getoutlookcontactusinfcsvfile gis globalization gtk httpwebrequest image index input install installer java label list listbox mandelbrot math mono mouseclick mysql operator panel path photoshop picturebox pixelinversion post programming radians regex remoting richtextbox save server silverlight sleep socket sql sql-server statistics stream string table text textbox thread time timer timespan update usercontrol users validate validation visualstudio webbrowser windows winforms wpf xml






