does anyone know where i can go to learn how to make a loading screen that will load my program while the loading screen is up ( and then close down the loading screen when it is done)? also, can anyone help me out on how to make a internet link in vb?
thank you all
C`ya
-Cow
usetheforce2 09-16-2000, 08:17 PM for the loading screen, you could either have a timer placed on a regular form "loading screen", then unload that form and "show" the your application form(the main app).
or
at the end of the load sub(on your main app) you could put something like unload frmLoading and show frmMyprogram.
yeah, i know i can do that but what can i do to make the program load while the loading screen is up? is there a certian code of something?
thx man for advice
c`ya
-Cow
BillSoo 09-16-2000, 09:24 PM Suppose you start with a main form. The load event for this form is the first code executed by your program.
The load event for this form executes *before* the main form actually becomes visible. So you could load another form first, make it visible, and continue to load the main form.
For example, suppose I have a second form called SplashFrm which is essentially just a splash screen. In the main forms load event, I would put something like...
Private Sub Form_Load()
Dim t#
t# = Now + 10#/86400 'current time/date + 10 seconds
SplashFrm.Show 'notice I do *not* show it MODALLY since if I did, execution would pause here
'do other initiallization tasks here....
'
'
'
'
While t# > Now 'wait extra time until 10 seconds have passed
doevents
Wend
Unload SplashFrm
End Sub
"I have a plan so cunning you could put a tail on it and call it a weasel!" - Edmund Blackadder
thx man. uhhh... well, i don't really get the:
'do other initiallization tasks here....
'
'
'
'
what do i put there? what is a intiallization task? could you please put up an example of what a initiallization task is? and also, what is a splash form?, i am completely new to vb. also, would the splash screen in your message be the loading screen? thx man
c`ya
-Cow
BillSoo 09-17-2000, 06:17 AM Well...the other tasks depend on your program. You don't have to put anything there if you don't want to...
One example would be connecting to a database and verifying the existence of certain tables, creating them if neccessary. This kind of thing takes time so in the meantime, you display the splash screen to give the user something to look at.
If you don't have any time problems loading your main form, then you don't really need a splash screen but I thought that that was the point of your question.
A splash screen is another term for a loading screen. Typically it is a simple form with some graphics on it which give the name of the program and maybe some basic info. For an example, just run VB. You get the main form in the background and a splash screen on top which says "Visual Basic 6.0, Enterprise Edition". This splash screen disappears after a couple of seconds.
Maybe I misunderstood what it was you were asking...
I thought that you were having trouble loading your main form, ie. it was taking too long to load. So you wanted advice on how to display a splash screen to occupy your user while your main form loaded. If that's not what you meant, perhaps you could clarify?
"I have a plan so cunning you could put a tail on it and call it a weasel!" - Edmund Blackadder
well, i don't know if i really need one or not with the program i am on right now. i just wanted to learn how to make one, even if it wasn't for this program i am working on right now, maybe for future programs. let's say i put the code you posted up, and put it into my program and made a splash screen, would it work because all i have in my program is a bunch of games, windows and web pages, and my web browser, i will be adding more soon. at the end i will probably have like 50 pages on it 5 or so games and a lot of windows so that is why i wanted to make a splash screen for it.
thx again
C`ya
-Cow
p.s.
also for my splash screen i want to take of the blue bar at the top of my window with the minimize button, the restore button and the close button on it?
also, in the code when it says something about 10 seconds, is that how long it is supposed to take to load all of the program ( or what it can in 10 seconds) or is that just to put the loading screen up for 10 seconds?
Kwalude 09-17-2000, 01:55 PM Do you mean a Splash Screen? If you use the Wizard when you create a new project, one of the things it will automatically generate for you is a Splash Screen. Along with a Help form if you want one. Once you have done it once, you can cut and paste the code into other projects. Just make sure you set the Start Up object right when you do this.
BillSoo 09-17-2000, 03:30 PM 10 seconds is just an example. Use whatever time you want.
To remove the blue bar from a form, remove the minimize button, the maximize button and the controlbox and also set the caption to nothing.
eg. set the ControlBox property to false, the MinButton property to false, the MaxButton property to false and delete the contents of the Caption property.
As for whether or not the splash screen will work for you, well, I guess you'll have to try it and see...
"I have a plan so cunning you could put a tail on it and call it a weasel!" - Edmund Blackadder
but with the code you gave me, if i put it into my program, would it load all of my program? just curious
and also, i have vb4, i don't think they have a project wizard, or do they in a secret place?
-Cow
BillSoo 09-17-2000, 08:57 PM The code I gave as an example does not load anything. If there were things you needed to load, you would add the code for that where I put
'do other intialization tasks
'
'
'
All the code does is display a splash screen to occupy the user while your main program load event does something else. But you still have to write the code to load the other stuff if you need to.
"I have a plan so cunning you could put a tail on it and call it a weasel!" - Edmund Blackadder
but in the 'do other intialization tasks' what code do i have to put in to load a window, for example:
Load mainfrm
what is the code i have to put in to load all the windows?
thx
-Cow
BillSoo 09-17-2000, 11:11 PM Depends on what you want do do...
If you want to load a form, you load a form eg.
Load Form1
Loading a form does not neccessarily *show* it, so the form gets preloaded into memory and later, when you do want to show it, it takes less time to display. The downside of course is that loading all these forms into memory consumes resources and if you aren't careful, you could crash your program with an "out of memory" error.
If these forms are MDI children, then you can't preload them without them showing. At least in VB4 I think. Before VB6 (VB5?) MDI children cannot be hidden.
Another problem is that some people put a show command inside the load event of a form (eg. me.show). Thus you can't preload these forms without them showing.
I can't really help you on specifics on what tasks to do or what forms to load. You have to decide that for yourself based on constraints like memory resources available, time to load, etc. etc.
"I have a plan so cunning you could put a tail on it and call it a weasel!" - Edmund Blackadder
thanks a bunch man, that is exactly what i needed to know, just what type of code i put in, thank you so much!
thanks! ;)
c`ya
-Cow
also, just curious, it is have to add in more than one code into one place, do i have to put in a code to seperate them or something or will it work just fine in this example ( it seems to in my program, i am just curious if it will work with all programs):
Private Sub Form_Load()
<font color="00FF00">webbrowser1.Navigate "http://www.altavista.com"
<font color="0000FF">Dim t#
t# = Now + 10# / 86400 'current time/date + 10 seconds
splashfrm.Show 'notice I do *not* show it MODALLY since if I did, execution would pause here
'do other initiallization tasks here....
Load mainform
'
'
'
While t# > Now 'wait extra time until 10 seconds have passed
DoEvents
Wend
Unload splashfrm
<font color="000000">End Sub
C`ya
-Cow
|