473,385 Members | 1,861 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,385 software developers and data experts.

Focus after Splash Screen

When my splash screen auto closes, the program's main form has its title bar dark grey instead of the usual dark blue, and I have to click somewhere on the main form to give it focus.

This problem doesn't show up when I run the program from within VB Express, but only after I've published to my own computer (to get easier access to the .exe file).

If I do away with the splash screen, then the published program starts with its main form having focus, as one would expect.

Any ideas how I fix this, please?

Regards
Allan Stead
Sep 2 '07 #1
8 2582
Robbie
180 100+
In VB6 there's a function ZOrder(), which is used like this:
Expand|Select|Wrap|Line Numbers
  1. SomeForm.ZOrder(vbBringToFront)
That function would probably do what you want to be done.

I don't know if this exists in the version of VB you're using.
But you could try searching through its functions or documentation for a way to bring it back to the top (since it might be named similarly to this...?)
Sep 3 '07 #2
Hi Robbie

Thanks for the suggestion. In VB Express the command appears to be Me.BringToFront() and I entered it at the end of the FormActivated event of my main program form, but it didn't solve the problem.

Thanks for trying, anyway

Allan
Sep 5 '07 #3
Killer42
8,435 Expert 8TB
... Me.BringToFront() ... end of the FormActivated event ... didn't solve the problem.
Try doing it immediately after the command which hides (or unloads) the splash form.

Also, though I don't know what your equivalent would be, in VB6 SomeForm.Show would work just as well, and would confuse less people. :) Admittedly though, the BringToFront() method sounds rather more obvious than ZOrder.
Sep 5 '07 #4
Try doing it immediately after the command which hides (or unloads) the splash form.

Also, though I don't know what your equivalent would be, in VB6 SomeForm.Show would work just as well, and would confuse less people. :) Admittedly though, the BringToFront() method sounds rather more obvious than ZOrder.
I'm not sure if I'll be able to take up this suggestion, as VB Express shows and hides the splash screen all by itself as an option from within the Application tab of My Project. Any idea how I can get at the hide or unload command?
Sep 7 '07 #5
Robbie
180 100+
Any idea how I can get at the hide or unload command?
No, but if VB Express is failing to give focus back, then it isn't working as it should.

Why don't you make your own one?
It's really very simple... if it's only meant to be an image:
Make a new form called SplashForm or something like that,
Add a PictureBox which shows the splash image,
Set the form properties so that no border is shown,
Add a timer which, after a certain amount of time, hides this form, and shows the main program form and tries to bring focus to it (using example code which Killer / I have suggested).

I would at least try that before giving up. ^-'
Sep 7 '07 #6
Here is some code to try:

Expand|Select|Wrap|Line Numbers
  1.     Dim Done As Boolean = False
  2.     Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
  3.         Me.Visible = False
  4.         SplashScreen1.Show(Me)
  5.         Do While Not Done
  6.             My.Application.DoEvents()
  7.         Loop
  8.         SplashScreen1.Close()
  9.         Me.Visible = True
  10.     End Sub
  11.     Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
  12.         Done = True
  13.     End Sub
  14.  
  15.  
Sep 7 '07 #7
Killer42
8,435 Expert 8TB
I'm not sure if I'll be able to take up this suggestion, as VB Express shows and hides the splash screen all by itself as an option from within the Application tab of My Project. Any idea how I can get at the hide or unload command?
I'm not familiar with this version. But I have heard mention of an option which hides "cookie-cutter" code, showing only your own. Perhaps you just need to turn off that option to see the code supplied by VB Express.
Sep 7 '07 #8
Budman
1
That worked great—very nice! I was pulling out what is left of my hair trying to get the focus back to the application after the splash screen went away. Using the Project Designer to specify a Splash Screen form does not cut it. Thanks loads.
Sep 26 '07 #9

Sign in to post your reply or Sign up for a free account.

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...
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...
2
by: Joe Cool | last post by:
Using VB in VS2005. 2005 has a new way to implment a spash screen that alleviates the need for hardly any code. But I have found that when a GUI that has a splash screen is run as a scheduled task,...
2
by: shajeel | last post by:
Hi, i m having a problem getting the focus on the form, i m starting two form one after another, here is the sequence. first is splash second is dialog taking values main() { Start new...
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...
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...
0
by: Brad Pears | last post by:
When my app launches I use a splash screen - the built in splash screen that comes with VB .net 2005. In my main forms load code (which comes up rigfht after the splash screen) , I attempt a...
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: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

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.