Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Load a form after another.

Posted on 2003-03-02
17
Medium Priority
?
128 Views
Last Modified: 2010-05-01
I have two forms. A splash Screen and a Main form.
I want the main form to load only after the splash screen.
I found out that they are both loading at the same time.
I'm using the splash screen as the first beeing shown.
I also have other forms that are Child of this main.
How do I do this?
Thank you!
0
Comment
Question by:figjus
  • 7
  • 6
  • 4
17 Comments
 
LVL 28

Expert Comment

by:vinnyd79
ID: 8051616
add a timer on the splash screen and set the spash screen as the startup form.Then add this to the splash screen:

Private Sub Form_Load()
Timer1.Interval = 3000 ' 3 seconds
Timer1.Enabled = True
End Sub

Private Sub Timer1_Timer()
frmMain.Show
Unload Me
End Sub
0
 

Author Comment

by:figjus
ID: 8051710
Yes, I have that but the frmMain still loads at the same time.for instance if i have a msgbox on form load of my main it will show even before the splash screen. then splash loads and then main is visible. but it still loads first.
0
 
LVL 3

Expert Comment

by:DeAn
ID: 8051747
is your splash form set as the startup form?
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
LVL 28

Expert Comment

by:vinnyd79
ID: 8052003
Right click on your Project File from the Project Explorer window.Then select Properties and make sure frmSplash is set as your Startup Object
0
 

Author Comment

by:figjus
ID: 8052097
yes it is. Startup object is my splash. this isn't supposed to happen... ugh?
0
 

Author Comment

by:figjus
ID: 8052103
I have another one set as child from this main and it doesn't load at the same time. actually I can't even load it!!! it's called: frmAbout
I'm using:
Load frmAbout
but it doesn't work... yeah i'm lame... :p
0
 
LVL 28

Expert Comment

by:vinnyd79
ID: 8052122
Can you post the code from your splash form? Have you used frmAbout.Show?
0
 
LVL 3

Expert Comment

by:DeAn
ID: 8052123
try frmAbout.Show
0
 
LVL 28

Expert Comment

by:vinnyd79
ID: 8052132
Also make sure your timer interval isn't too low.
A value of 3000 will be about 3 seconds.
0
 

Author Comment

by:figjus
ID: 8052156
I've tried frmAbout.Show but it says :"no MDI form available to load". Still don't know why but msgbox keeps showing up. Here's my timer:

Private Sub Timer_Timer()
LoadingBar.Max = 50
If LoadingBar.Value <> 50 Then
   LoadingBar.Value = LoadingBar.Value + 1
Else
    Timer.Enabled = False
    frmMain.Visible = True
    Unload Me
End If
End Sub
0
 
LVL 3

Expert Comment

by:DeAn
ID: 8052189
you need to add an MDIform as parent form... not regular form
0
 
LVL 28

Accepted Solution

by:
vinnyd79 earned 120 total points
ID: 8052209
and try this for the splash screen. Make sure you set the timer's interval property.Try setting it at 100 and adjust as necessary.

Private Sub Form_Load()
LoadingBar.Min = 0
LoadingBar.Max = 50
LoadingBar.Value = 0
End Sub

Private Sub Timer_Timer()
If LoadingBar.Value < 50 Then
  LoadingBar.Value = LoadingBar.Value + 1
Else
   Timer.Enabled = False
   frmMain.Visible = True
   Unload Me
End If
End Sub
0
 

Author Comment

by:figjus
ID: 8052213
Well all I want to do is: when user is on the other form he can't by all means select the main until he cancels the about. who do i give credit for this????
0
 

Author Comment

by:figjus
ID: 8052218
Thank you vinnyd79, I guess credit goes to you, but could you help me with this other problem? Thank You.
0
 
LVL 3

Expert Comment

by:DeAn
ID: 8052233
I suggest making the about form NOT a child and set it as model:  frmAbout.Show 1

whatever you think for points, doesn't matter to me
0
 

Author Comment

by:figjus
ID: 8052295
DeAn I apreeciate that, it worked as I wanted. Anyway I'll give points to vinnyd79 because of the code he gave me. Sure more work.
Thank all anyway, Thanks really!
0
 
LVL 28

Expert Comment

by:vinnyd79
ID: 8052302
I agree with DeAn. You might want to set frmAbout's StartUpPosition property to "CenterOwner" as well.
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses
Course of the Month15 days, 10 hours left to enroll

581 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question