473,399 Members | 2,278 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,399 software developers and data experts.

Splash window

Hi ,

I use formBorderStyle = "None" for the splash window.
If I will not open if as a Dialog (frmSplash.ShowDialog) then the form
will not be on the front of other windows.
From another side when I use "ShowDialog" code stay "frozen" for the

time of Splash is opened.

Any idea how to move formBorderStyle = "None" form to the front.
I will use frmSplash.Hide at the end of MainForm_Load procedure

Thanks,
Mike

Nov 21 '05 #1
8 1859
Try setting Form.TopMost to true on your splash screen. Don't forget to set
it back to false as you hide your form.

Chris

"Mike" <y1***@yahoo.com> wrote in message
news:11*********************@o13g2000cwo.googlegro ups.com...
Hi ,

I use formBorderStyle = "None" for the splash window.
If I will not open if as a Dialog (frmSplash.ShowDialog) then the form
will not be on the front of other windows.
From another side when I use "ShowDialog" code stay "frozen" for the

time of Splash is opened.

Any idea how to move formBorderStyle = "None" form to the front.
I will use frmSplash.Hide at the end of MainForm_Load procedure

Thanks,
Mike

Nov 21 '05 #2
I answer this question in VB.NET forums more than any other question.

Do this:

1) Start a new Windows application
2) Add a new form (Form2) & a module (Module1) to your project
3) Make Module1 (sub main) your startup
4) Module code (copy/paste) into Module1:

Module Module1

Public spl As New Form1
Dim nThread As New System.Threading.Thread(AddressOf nThreadProc)
Sub main()
spl.Show()
Application.DoEvents()
nThread.Sleep(5000)
nThread.Start()
End Sub

Sub nThreadProc()
Application.Run(New Form2)
End Sub
End Module

5) Switch to Form1 & add a label (Label1) & set its text property to
'Splash Screen' - just to prove it the splash screen

6) Switch to Form2 & add a lable (Label1) & set its text property to 'Main
Form' - to prove its the main form

7) In the form load event of Form2, type:

spl.Close() ' sp1 is the variable I used in the module for the splash
screen.

Note:
-------

In the module is 'nThread.Sleep(5000)'. Change this to whatever value you
wish the splash screen to be shown for (5000 = 5 seconds)

Note2:
------

For those pedantic people like Herfried (Mr MVP (Copy/paster)) 5000 does not
mean 5 seconds exactly because it depends on the system being used. Some
processors run faster than others... and therefore 5000 maybe 5 second on
one machine, but 4990 maybe 5 seconds on a different machine and so on.

I hope this helps

Crouchie1998
BA (HONS) MCP MCSE
Official Microsoft Beta Tester
Nov 21 '05 #3
I tried you preposition myself but it did not work.
From another posting of Crouchie1998 I took idea about using

Application.DoEvents()
and that really helped after I use 3 lines istead of 2:

frm.TopMost = True
frm.Show()
Application.DoEvents() ' My problem was here - I forgot this line

Thanks,

Nov 21 '05 #4
What the reason using you code if you still use nThread.Sleep(5000)
The same result I can get by ShowDialog

I idea was using splash during init processes - connect to DB, etc

Anyway, part of you code (Application.DoEvents() ) helped me decided
the problem,
try

frm.TopMost = True
frm.Show()
Application.DoEvents() '' line from your answer

,,,,,,,,,,,,

Finally
frm.Hide()

Nov 21 '05 #5
You are the first person in over 2 years & that is over 50 people who have
ever said anything like this. Are you sure you have it correct?

Crouchie1998
BA (HONS) MCP MCSE
Official Microsoft Beta Tester
Nov 21 '05 #6
It work for me - the splash window will be closed exactly before main
window will be shown, the part of code I shown previously

when I wrote : "The same result I can get by ShowDialog " - I mean that
the timer can be set inside splash window and do "Me.close" after 5 sec

Nov 21 '05 #7
But if you do it the way you have it then your code only hide the splash
screen & keeps it in memory, whereas, the code I supplied unloads the form
fine.

My code doesn't use a timer because the Thread .Sleep method instead

I supplied the same code to a Microsoft software developer in the got dot
net forum & he was well happy with it too. Anyway, as long as you are happy
with your solution then that's ok to be the odd one out.

Take it easy

Crouchie1998
BA (HONS) MCP MCSE
Official Microsoft Beta Tester
Nov 21 '05 #8
if you do not like Hide, use
frm = Nothing and garbage collector do everything for you
btw it will do it anyway because variable is local and defined : Dim
frm as frmSplash

Any decidion has to have any sense but I do not see reason why do you
create additional thread and Sleep it?
If you can please explain this.
Create a new thread or use ShowDialog at my undestanding absolutely the
same - the rest of the code not executing.

I do not claim that the found decidion the best but it do whateven I
need - show the splash for exactly the same amount of time needed for
DB connect, init controls etc.

Nov 21 '05 #9

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...
2
by: AK | last post by:
Hi, I have a Windows Forms .NET application - I'm trying to display a splash screen. I've checked out the online suggestion : http://support.microsoft.com/default.aspx?scid=kb;en-us;186459 I...
14
by: SStory | last post by:
I am trying to make a splash screen for my vb.net app. It is an mdi app. including the splash code produces wierd results. not inluding makes things fine. Also have tried loading the splash...
1
by: Ken Allen | last post by:
I am developing a small utility program that must perform a considerable amount of 'background' or 'research' work before it can display any user interface. In general it can take 3-15 seconds to...
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...
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...
0
by: driplet | last post by:
In BCB I created a splash window as a starting window of my application program. I setup a timer on the splash window so that it can be automatically closed after showing up some times and then my...
0
by: cwalden | last post by:
Hello, in my project i want to create a splash screen and after 5 seconds load the proper hta. But when i load it the splash is just white. I have to put my mouse over it to see the splash screen. ...
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
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,...
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
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
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...
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,...
0
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...

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.