Learn Visual Basics Tutorial Project3 Part3 Screen Blocker
Ok the next thing we want to do is make an escape button,,, this will close down our program in case something goes wrong so we don't have to ctr alt delete and lose all our stuff,,, and this would also be a good time to save your project to a file on your desk top..
So we draw a decent size command button on the form and then double click on it and type in side unload me and then under that end
If you happen to get a error with that line unload me or it doesn't work then try Unload.Me
This is the command to shut down the program.
We wont bother changing the caption or anything on the button because we will delete it after the project is complete
Now we're going to remove our border around our form because we don't want anyone to be able to shut this down without using the pass word
Do this by using the property menu like this
Ok well the next thing I'm going to show u how to do is put a pic on your iface,,
So 3rd last icon on the left above OLE is a icon if a pitcher not to be confused with the one that's right up the top as thats a pitcher frame,,,
We click on the pic and draw a big box on the iface then go over to properties and find the pic we want to use,,, because this is a full screen program we want a pic that's really big,, so a wallpaper or screen saver pic something like that will be good
So go over to pic and then click eh button locate the pic which you should have put it in your folder already then add it,,
Then we just going to right mouse click on the pic and say send to back
Ok time to make our release button,,
Click on button 2 which should be titled unlock and type in there
If text2 .text = text1.text then
Unload me end
Else
Label1. caption = " wrong pass "
and then under that end if
Anyone notice anything wrong with that ..?
Yerp that's right we need to tell it to make the label so we can see it,, so
So under the else command label1 . Visible = true
now we want to run it and see how its going
ok let check to see of our
please add pass word is working,,, buy not typing a pass work in..
which it is
and then lets tell it the pass word is 1 .. and then in unlock put in the wrong pass word. 123
ok that's good,,, says "wrong pass word"
mm now that's blending into the back ground so let's change the colour of the form again to something deferent
right now I'm just going to make shore our frame blends in by changing it to black seeing the pic im using is all black around the area,,, and then run the program.
Now I'm going to change the label from opaque to transparent.
then were going to stretch the form out as far as i can get it
this is so we can get the pic to coverer the whole form,,,
we could do this with coding but ill show you how to do that in up and coming tutorials.
This time we will just use the property menu for it
Well even thou we have stretched out the picture box the pic its self isn't moving,,, what we need to do is change its property's to stretch like so.
Then we change the BG of the form to black to mach our pic just in case there are some gaps left over
23
views
Learn Visual Basics Tutorial Project3 Part2 Screen Blocker
k next thing we need to do is go into load ether by using the drop down box or double clicking on a blank part of the form and type frame1.visible = false.
This will make it so when the form loads the frame 1 with the text and button won't be seen ull see y in a few minutes.
Then we click on button one and right in if text1.text = enter code here then Msgbox "you must ever a lock code.
No scrap that we have done message boxes b4 so let do it with a label instead.
So make a label on your form nice and big,,, then go back into button 1 and right after the THEN
Label1.catopion = "you must enter a pass word"
Else
Label1.visabull = false
That's so if the label has been trigged it will then disappear and if its not trigged then it will just ignore that part.
Then put under that frame 1 dot visible = true
Then in load we will put label1. Visible = false
Because when the program starts we don't want to see the label.
Now ill leave out end if so u can see what happens when we try and run the And then we run it to see
Block if without end if,,, VB is good that it will tell u that u suck..lol
So we just right end if.
Ever one always makes mistakes when programming it's not the fact u make mistakes it whether or not u can work out what you have done wrong and then how to fix them,,
So let's try it again,,,
Ok that bit works,,, but our label isn't showing up,,,, any guesses why ?
If you said ya ant told it to show up,, then dead on .
So just in command button one line after the THEN we need to put label1 Visible = true
Now we try running it again and see what happens
Arr there we go,,, that what we wanted to see,,,
One of the big things with programming is deductive reasoning,,, when ever your making a program from an idea in your head you're going to be doing a hell of a lot of,, ok what do i have to do to get this to do this,, and what happens if i do that,,, and how the hell do i fix this,,,
To me this is the fun part about programming its like a big puzzles or even a video game,,
So type in our pass word, 123456 click our button and the frame shows up,,,
Now we just have to add our unlock part of the program.
Before we do that lets just fix this label up.. justify to centre and make the text bold and size 12 so it can be seen easy then let's change the appearance from 3d to flat and put a border around it.
Then we run it to see how it looks,,
47
views
Learn Visual Basics Tutorial Project3 Part1 Screen Blocker
Welcome to learn VB6 this is Part 1 Project 3
My Name is gym and today I'm going to show you how to make a very basic screen blocker to help you to get to know the functions of VB 6.0 better.
This program were going to make today can be used to stop ya kids or brothers or sisters from jumping on the pc whenever you get up to go to the dunny or something,,
or if you're running some kind of program that's taking a long time to compile or to complete and ya don't want it messed with wile ya getting a drink or whatever then this might come in handy.
But the main function of this program is just to tech you basic commands on VB 6.0.
1st thing we need to do offcourse is open up Vb6 and choose new exe.
1st object we need is a textbox to put out lock password in.
Then we need a button.
This will be used to lock in our password.
Then were going to use a frame,, we haven't used one of these b4 so ill show u one of its many uses.
Frame is the icon under the label and beside the command button when using 6.0..
Other VBs like 2005 and 2008 ECT use the pretty much the same coding.
But in the next few weeks im also going to have tutorials on 2005 and 2008 for ya's so if your using one of thous then you should find that useful.
Anyhow click on icon frame, and draw a frame on your project like so.
Then were going to put another text box on top of the frame which will be used to enter our pass word to unlock the screen blocker and a command button to enter the code.
I'm just going to change the colour of the frame so it makes it easier to see on this tutorial as well easier to see while working with it.
Now I'm going to change the colour of our form for the same reason
And I'm going to take away the caption of the frame because we don't need it and the boarder like so
Next I'm going to justify the text on text 1 to centre and then change the name to "enter lock code here" .
Then I'm going to do the same with text 2 by just coping and pasting.
Finding short cuts when making programs is always a good idea as they are usual so time consuming to make anything that speeds up the process is always a good idea.
We're going to change button 1s caption to Lock and button 2s caption to Unlock.
I'm also Just going to quickly adjust the sizes of these thou it not real important just yet.
Then going to double click on text1 and change it from text1_change to text1_click.
Then right under it text1.text =""
This will make it so when we click on the text box to right in our code the test will clear its self.
And we will repeat the presses for Text box2 , Remember to change the word change to click and then right Text2.Text =""
10
views
Learn Visual Basic 6 VB6 Alarm Clock Part 2
Welcome to part 2 of project 2 making a alarm clock ..
My name is Gym and today were going to be moving on with the coding part of our second project
Ok lets got on with it,, this line of code is only 1 of 2 most complicated lines in the whole program,, and ill try to explain to you what its saying.
If Time = (Text1.Text) & ":" & (Text2.Text) & ":00 " & (Text3.Text) Then
we use brackets because then it means the object text1..
if we used quotation marks then it means that exact thing written,, in other words it would only sound the alarm when the time read text1.text..
lol and I'm not shore what hr of the day that is..lol.
Ok after the then its timer4.enabled = true and timer4.intervull = the length of you wav file you have selected,, now remember that 1 second = 1000 so if you have file is 3 secs long you want the interval to be 3000.. to find out the leant of your wav file right mouse click then properties .
then finish i of with end if
Ok now in Timer 3 we want to right
if option1 ="1" then
Text3.text = "AM" 'in capitals
else
Text3.text = "PM" 'in capitals
Okays now in form load we need to have timer 3 switched on from load up so instead of typing it all out again just copy timer 1 enabled with interval and past it below and change t it from timer 1 to timer 3
Now we have to do the on and off button so in the on button we right timer2 enabled = true and then interval =1 and then we want the caption to change in our status label so we right label 2 caption = "Alarm is on" don't forget the quotations
Then in the off button we need it to say timer 2 enabled = false and then
Label 2 caption = "alarm is off"
and we also what to have that button to not only turn off the timer that tells wether the times mach we want to use it to turn off our wav file once it has sounded so we right timer4. Enable = false
Ok now here is the hardest bit of them all... we want to use the drop down box to find general and then make shore it sees dilacerations,,,
And in their we going to right
Private Declare Function Playwave Lib "winmm.dll" Alias "sndPlaySoundA" (ByVal lpszSoundName As String, ByVal uFlags As Long) As Long
Call Playwave("Alarm.WAV", 3)
18
views
Learn Visual Basic 6 VB6 Alarm Clock Part 1
Welcome to Learn VB6 basics 6.0
This is tutorial 2 part 1
In this project were going to get a little more advanced so if you have never used Vb6 before then please start at tutorial one,,,
This tutorial is amid towards some one who has just started out but has played around with this software a little before..
Now in this episode were going to be making a alarm clock and this is what its going to look like.
Before we start I'm to walk you thought the basics or the principals behind the working of this
Up the top is a clock witch we learnt how to do in our 1st tutorial
And the 8:45 is our alarm time.
This is basically going to work by starting a timer that keeps asking dose the current time match the time below that we want our alarm to go off at .
When it dose match it will set another timer off and running that calls our .wav file / our alarm sound
And a few other very basic things that i will point our as we go along.
Okays well the very 1st thing you need to do b4 we get started is find your self a wav file that you would like to use as the alarm sound .
So to do this just go to your favoured search engine and type in Alarm wav or bell wav or buzzer wav what ever you like,,
The only constraints u must have is the file extension ends as .WAV as MP3 or WMP will not work the way we are setting up the program.
Another handy hint for you is you can always run search on your Pc and say .W-A-V and u will see hundreds of wav files that you can click on and find one that you like the sound of..
Please make shore when u take a wav file off your PC you don't just take it.
Make shore you right mouse click copy and then past it in your folder that you want to store this project in on your desk top..
Then down put it in a folder that you have called say alarm clock.
The wav file must be kept in the same folder as the project so it can find it that is very important.
So put this on pause and come back after u have a wav file ready to use.
17
views
Learn Visual Basic 6 VB6 -101- Tutorial Project 1 Part1
Welcome to a Tutorial on Very Basic lesson on Learning to program in VB6 in this 1st part we learn how to open up Vb6 and start a new project. 1st thing every one learns in VB is how to make a pop up Message box host by Gym_
42
views
Learn Visual Basic 6 VB6 -101- Tutorial Project 1 Part 3
Part 3 on project 1 About how to learn to program with vb6 this is a very basic Tutorial for 1st time uses. This is Part 3 of Tutorial 1 and were going to learn a little bit about labels and timers and Textbox's
12
views
Learn Visual Basic 6 VB6 -101- Tutorial Project 1 Part 2
Part 2 on project 1 About how to learn to program with vb6 this is a very basic Tutorial for 1st time uses. This is Part 2 of Tutorial 1 and were going to learn a little bit about labels and timers
6
views