DFBarracks - Forums

Delta Force Barracks Forums - Powered by XMB 1.9.11
Delta Force Barracks Forums
Not logged in [Login - Register]
Go To Bottom

Printable Version  
Author: Subject: Tutorial Level: Beginner : Open/Close Forms, Password protect your program.
bullet magnet


Posts: 263
Registered: 6-26-2005
Member Is Offline

Mood: Modding

[*] posted on 6-29-2007 at 07:54 AM
Tutorial Level: Beginner : Open/Close Forms, Password protect your program.

Lets discuss how to password protect a form.

1.) Make a form1, this will be the form to enter password.

2.) Add a textbox, and in its properties window, find Password Character, and enter what you would like to show up when the user presses a button (for example: *)

3.) Now add a Button, and under its click event type this code.
[size=3] If TextBox1.Text = "Password Name" Then Me.Hide() Form2.Show() Else MessageBox.Show("Incorrect Password") End If [/size]

That will close the Password form if the text is correct, and show the actual program (form2)

Always use "Me" when reffering to the form you are coding in, such as Me.Show or Me.Hide, but when calling other forms, not the main one, use Formname.Show or Hide.

You can add something after the Form2.Show such as:

[size=3]MessageBox.Show("Correct Password")[/size]

Bullet Magnet

View user's profile View All Posts By User

  Go To Top

Powered by XMB 1.9.11
XMB Forum Software © 2001-2012 The XMB Group
[Queries: 15] [PHP: 54.7% - SQL: 45.3%]

Copyright © 2002 - 2008 All Rights Reserved - DFBarracks.com
Site Design by A.Bullet - ScreamingDemon.com