Learn Vb.Net 2008 L3 Password Protected Form 2 Forms & If

Tags:
2005 2008 And Basics Close Form Forms If Open Password Protected Stat Studio Vb VB.NET Visual Visualbasics.net
Gymjunnky
  • Affiliate Submitter:
    Gymjunnky
  • International International
  • Comments: 0
  • Views: 530
  • Added: 24-Mar-08

Gymjunnky.com Welcome to learn vb.net this is tutorial 3 and my name is Gym_
In this lesson were going to learn some tricks with duel forms and learn how to do some very basic pass word protected applications
So lets get right to it,,
1st thing is open up VB.net ether 2005 or 2008 if you have Vb6.0 have a look on my channel or website and your will find plenty of tutorials for VB 5 and 6.0
Ok so lets get on with the show shall we.
Going to open up windows form application and change the name to project 3 and click ok
Then im going to draw a button on the form
Then im going to add a 2nd form
Do this by clicking on project link at the top of VB and then the add windows form tab
Then were going to scroll right down the bottom till we see windows form and ether double click on it or high light it and click OK
This is going to add the 2nd form to our project
After that were going to double click on the button we made on our form1 and insert the codes to open and close our forms
Form2.show is used to make our 2nd form visible
And me.hide closes no1 form in vb6.0 you could use form1.hide but in 2005 and 2008 you must use the term ME as reference to the form that the code is being placed into
And that's it all of 4 words to open and close 2 forms
So let's run the program and have a quick look
Cool that works
So again let's try something a little more advanced,,, let's make form 2 pass word protected
Click on the text box icon and draw a textbox on form 1
If textbox 1 . text = "123456" then
Ok see the blue line its telling us that there is a error,, and if we hover our mouse over the top of it u can see its telling us there is no end if at the end of the stamen
So after we make shore we have our quotation marks in place let's put in that end if statement
And lets run the program again
Click the button and nothing happiness
Put in the wrong pass word and click the button
And nothing happens
Enter the correct password and form 2 shows up and form 1 closes
Now that certainly dose the job but how about we make it a bit better
So 1st thing i want to do is change the colours on the forms so it can be seen a lot more easily on video.
Lets change form1 to blue and form 2 to a dark red
Ok to improve the function ability of this pass word protected form let put in a else statement
After form show and hide type in Else
Then Msgbox " wrong pass"
This means that is the if anything ells what so ever happens besides that pass word being right then the else stamen kicks in and in this case provides us with a message box saying wrong password
Ok so lets see this in action shall we
Run the program click the button with no pass word in we get message box
Type in the wrong pass word,,, and we get message box
Type in the right password and get form 2 appearing and form to leaving
..
what about if we want multiple boxes like how that have the key login on windows and a lot of other software as your instilling it.
Very easy lets put 2 more text boxes on our form
And then go into our code and put
If text1 . text



"123456" and text2 . text
"123456" and text3. Text

  1. Categories: How To
Comments on

Learn Vb.Net 2008 L3 Password Protected Form 2 Forms & If

15 Comments | Add Comment
  • me too me too

    me too me too

    By nextblain [Affiliate User] 1216016947 Reply Spam Moderate Up Moderate Down
  • THANK YOU SOO MUCH! ...

    THANK YOU SOO MUCH! this tutorial was awesome! your voice is amazing!

    By nextblain [Affiliate User] 1216016885 Reply Spam Moderate Up Moderate Down
  • very good quality.

    very good quality.

    By uploader75 [Affiliate User] 1215766799 Reply Spam Moderate Up Moderate Down
  • that was funny ...

    that was funny tutorial and its awsome thank you

    By kylebond29 [Affiliate User] 1214933804 Reply Spam Moderate Up Moderate Down
  • Thank you! Solved ...

    Thank you!
    Solved many of my questions the rest of the internet could'nt explain!

    By baronblod2003 [Affiliate User] 1214235909 Reply Spam Moderate Up Moderate Down
  • awesome :D thanks !

    awesome :D thanks !

    By shortcut007 [Affiliate User] 1214200386 Reply Spam Moderate Up Moderate Down
  • nvm its freeee

    nvm its freeee

    By astonmarten [Affiliate User] 1214055735 Reply Spam Moderate Up Moderate Down
  • does anyone have a ...

    does anyone have a serial for vb 2008?

    thnx

    By astonmarten [Affiliate User] 1214052208 Reply Spam Moderate Up Moderate Down
  • Cool!! Although I ...

    Cool!!
    Although I prefer to use usernames and passwords with a DB(Access,SqL,oracle).
    There for gives you the chance to alter you username or your password if you want to...and of course it should be a little more safer.
    But it's cool though...not bad dude.

    By kaiserxblue [Affiliate User] 1213643448 Reply Spam Moderate Up Moderate Down
  • how do you make it ...

    how do you make it abble to let 2 or 3 passwords work?

    By iamthinking123 [Affiliate User] 1213642883 Reply Spam Moderate Up Moderate Down
  • u r the best teach ...

    u r the best teach what i had listen !!!! but don forget , im in CST university :) ~!!

    bravo

    By gonidelux [Affiliate User] 1213483570 Reply Spam Moderate Up Moderate Down
  • nice one, i like it

    nice one, i like it

    By vsmartyr [Affiliate User] 1212719044 Reply Spam Moderate Up Moderate Down
  • Visual Basic 6.0 ...

    Visual Basic 6.0 Tutorials ? My channel is the page !

    By SilverMagics [Affiliate User] 1212600853 Reply Spam Moderate Up Moderate Down
  • I have a question: ...

    I have a question: If someone was to try to run the program, and the password thing came up, if they didn't know the password could they exit the password thing and not be able to get into the program? AND if they could exit the password thing would the program just load anyway? How do you make a button to quit or make it so that if someone exits the password thing the program IS NOT loaded?

    If it does not let the person use the program if the password thing is exited already, that's cool.

    By StealthTools [Affiliate User] 1212150919 Reply Spam Moderate Up Moderate Down
  • Wicked awesome... I ...

    Wicked awesome... I am soo going to code more this summer and probably make the proggy I have been working on a whole lot better.

    By StealthTools [Affiliate User] 1212150704 Reply Spam Moderate Up Moderate Down
15 Comments | Add Comment