|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
VB.net 2005 splash screenI have set a splash screen form as the application splash screen in VB.net 2005 I t runs fine but stays on top when my login screen appears How can I shut the splash screen down when the login screen is shown Attempts to close it from the application main form results in error message e.g frmsplash.close 'Cross thread operation not valid' Any ideas Regards Steve 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. Hi Walter
I don't know how much they pay you but it isn't enough Thanks heaps Regards Steve Show quoteHide quote "Walter Wang [MSFT]" <waw***@online.microsoft.com> wrote in message news:KbnoZLGkGHA.4528@TK2MSFTNGXA01.phx.gbl... > > 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. > Hi Steve,
Thank you. It is always our pleasure to be of assistance. Have a nice day! 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.
changing the date format in vb.net
Datasets - use 1 or many? Assigning the result of a '/' division to an integer type causes rounding How to force upper case in a DataGridView column? Dealing with NULL values in Integer fields Mulples threads and impersonation Calling a batch file from vb.net with parameters Handle pointers from delphi client to a vb.net dll What's the Best Startup Scenario for Unattended Server Execution? From Delphi to VB |
|||||||||||||||||||||||