473,395 Members | 1,885 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

VB.net 2005 splash screen

Hi All

I 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
Jun 15 '06 #1
3 7625

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.

Jun 15 '06 #2
Hi Walter

I don't know how much they pay you but it isn't enough

Thanks heaps

Regards
Steve

"Walter Wang [MSFT]" <wa****@online.microsoft.com> wrote in message
news:Kb**************@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.

Jun 15 '06 #3
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.

Jun 16 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Bill | last post by:
Problem 1) Any ideas on how I would get a splash screen to appear for a certain amount of time when I open a database - it's to display a text based disclaimer message. I know about message...
3
by: andrewcw | last post by:
I implemented the simplest of splash screens ( static and on its own thread ). But it seem that when first called maybe 8 seconds elapsed before it showed up, the main form follows several seconds...
5
by: steve | last post by:
Hi All I have a form set as the splash screen in VB.net 2005 application properties How can I tell when it has or is closing, as I want to then run some licence checking code without the...
3
by: steve | last post by:
Hi All I have a VB.net 2005 App which has a form set as the Application splash screen in Project properties Another form is set as the startup form All works great until the splash screen...
0
by: Steve | last post by:
Hi All I have an odd thing happening with my splash screen form The splash screen is set in Project properties and in the 'new' event of the splash form I run some code (before the...
2
by: will_456 | last post by:
In vb2005 Express: In My Project Application Splash Screen I have selected my splash screen form. The form opens on project startup but closes immediately before anyone would have time to read...
10
by: =?Utf-8?B?UmljaGFyZCBCeXNvdXRo?= | last post by:
Hi In my app I have a SplashScreen, a login form and a main form. On launching the app, I'd like to show the SplashScreen while reading config files and attempting a database connection. I show...
1
by: BRAHM | last post by:
I am using this code to set up the splash screen startup time. Protected Overrides Function OnInitialize( _ ByVal commandLineArgs As _ System.Collections.ObjectModel.ReadOnlyCollection(Of...
4
by: Gaz | last post by:
I am having a bit of a problem getting my application to work properly. RIght here is my problem... WHen my C# windows app loads up the start form, i create a new thread and show the splash...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.