- This topic has 0 replies, 1 voice, and was last updated 18 years ago by Admin.
-
AuthorPosts
-
October 7, 2006 at 7:53 am #190443AdminAdministrator
k…i had a couple ppl ask me how i did the splash screen on my ban remover…
its actually extremely simple…
i will explain it using the template that vb6 provides for you…
first, open vb and select standard exe
then, click ‘add form’ and a new window should apear. select ‘splash screen’you should get this;
you should not change the version or product…this will be automatically changed on form load…the way to change these is to go into the project properties: found at “Project>Project1 Properties”
then, change all the data on that form except the afore mentioned labels
now, you will want to add a progress bar, right? right…
heres how you do that;
press “Ctrl + T” on your keyboard and a new window should pop up. you want to scroll about half way down that window and put a check mark next to “Microsoft Windows Common Controls 6.0 (SP4)”
apply then close and you should now have 9 new buttons in your components toolbox. you want to click on the progress bar control which looks like this;
now put that where you want it on your form. i chose this;
i had to move some labels around to make it fit, but you can do what ever you want…
next, you need to add a timer control, which looks like this;
you can put that anywhere on the form, it wont be visible at run
now, you need to add the code to the timer…
double click on the timer and you should see this;
Private Sub Timer1_Timer() End Sub
in between those two lines, you want to add this code;
If ProgressBar1.Value < 100 Then ProgressBar1.Value = ProgressBar1.Value + 1 Else Unload Me Form1.Show vbModal End If
so it should look like this;
Private Sub Timer1_Timer() If ProgressBar1.Value < 100 Then ProgressBar1.Value = ProgressBar1.Value + 1 Else Unload Me Form1.Show vbModal End If End Sub
what you just did; the first 2 lines of that code moves the progress bar 1% at a time
the 4th line will unload the splash screen and the 5th will show the main formyour not done yet, if you click run, the progress bar wont move
heres why; right now, the time interval is set to ‘0’ you need to change that. now, depending on how long you want to show the splash screen is what the interval needs to be set at. i usually set mine at 100 – that is 100 milliseconds – meaning that the progress bar will progress 1% every 1/10 of a second, which is about 10 seconds…
your still not done, right now, Form1 is the startup form, that needs to be changed…go to “Project>Project1 Properties” and change the startup object to ‘frmSplash’ or what ever you name the splash screen;
if you’ve followed all the steps, you should have it down…like i said, its extremely simple…
if i made anything unclear, or you have any questions, please let me know…
-
AuthorPosts
Related
- You must be logged in to reply to this topic.