Hi Steve,
Thank you for your post.
Based on my understanding, you're using a background thread to show the
splash form, and tring to close it when the login form shows. If I've
misunderstood anything, please feel free to post here.
Windows Forms uses the single-threaded apartment (STA) model because
Windows Forms is based on native Win32 windows that are inherently
apartment-threaded. The STA model implies that a window can be created on
any thread, but it cannot switch threads once created, and all function
calls to it must occur on its creation thread.
The STA model requires that any methods on a control that need to be called
from outside the control's creation thread must be marshaled to (executed
on) the control's creation thread. The base class Control provides several
methods (Invoke, BeginInvoke, and EndInvoke) for this purpose. Invoke makes
synchronous method calls; BeginInvoke makes asynchronous method calls.
So for your question, the splash form can be closed using following code:
frmsplash.Invoke(new MethodInvoker(AddressOf frmsplash.Close))
Also, Visual Basic 2005 has builtin support for splash form. Please refer
to following msdn documentation:
#My.Application.SplashScreen
http://msdn2.microsoft.com/en-us/1t310742.aspx
Hope this helps. Please feel free to post here if anything is unclear.
Regards,
Walter Wang
Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.