Is there anything wrong with this code?
namespace RotnetSudoku
{
public partial class splash : Form
{
public splash()
{
InitializeComponent();
fclsStartScreen frmStartscreen = new fclsStartScreen();
frmStartscreen.Show();
this.Visible = false;
}
}
}
Apart from the indentation?
When i run it ithe splash form doesn't close...Also, if i change
this.Visible= false;
to
this.close();
, 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()
:!: :sad: :mad: