473,765 Members | 1,959 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 7655

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.Invok e(new MethodInvoker(A ddressOf 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******** ******@TK2MSFTN GXA01.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.Invok e(new MethodInvoker(A ddressOf 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
6922
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 boxes in VB but I don't my users having to click on an OK buttone each time this appears. Problem 2)
3
2259
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 later. Naturally recalling the application, the response is adequate I have 10 classes in my project. Some small, none really huge. And another form public class frmQCLoader : System.Windows.Forms.For { private System.Windows.Forms.DataGrid...
5
6411
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 splash screen interfering with msgboxes which may need to be displayed if the licence is invalid or missing I have tried in the splash form's formclosing event but it does not fire
3
2335
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 closes or I close it to allow error messages to be displayed from Licence or Database checking errors
0
1211
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 initialisation) to launch a form asking the user to select which SQL Server 2005 databases to connect to. All worked well I recently added a timer control to check for application inactivity and to
2
4219
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 it. I presume it only stays visible while the main form initialises. This is not long enough but I can't see how to slow it down. Should I set the splash screen using the Application settings or go back to
10
22378
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 progress of these tasks on a label on the SplashScreen form. Once this is completed ok, the splash screen should close and the login form should be displayed. A successful login closes that form and shows the main form.
1
3056
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 String) _ ) As Boolean ' Set the display time to 5000 milliseconds (5 seconds). Me.MinimumSplashScreenDisplayTime = 5000 Return MyBase.OnInitialize(commandLineArgs) End Function
4
5222
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 on the new thread and put the main thread to sleep until the splash screen has done the business, then i kill the new thread and start another to show the login and again put the main one to sleep. Problem i have is that my splash screen will show...
0
9568
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10007
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9951
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9832
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7378
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5275
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3924
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3531
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2805
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.