[Help] MAKING A CHECKBOX TO SAVE LOGIN

Posts 1–15 of 17 · Page 1 of 2
[Help] MAKING A CHECKBOX TO SAVE LOGIN
Can anyone help me make a check box to save the login stuff? I got the simple steps for username and password. All i need is the check box to remember the username and password

if textbox1.text = "username" and textbox2.text= "password" then
msgbox ("LOGGED IN")
button1.enabled
button2.enabled
and other stuff
First, go to Solution Explorer, then look for the bold letters on the top, that should say your project name.
Right click on the bold text, and click properties, then go to settings.
You will need to add 2 settings.

For the first one, the name will be:
Code:
username
And the value will be empty.

For the second one, the name will be:
Code:
password
And the value will be empty.

Now for the code:

Checkbox1:
Code:
If CheckBox1.Checked = True Then
My.Settings.username = TextBox1.Text
My.Settings.password = TextBox2.Text
Form2.Show
Me.Hide
Else
Form2.Show
Me.Hide
Then for the button that inserts the username and password:

Button2:
Code:
TextBox1.Text = My.Settings.username
TextBox2.Text = My.Settings.password
Quote Originally Posted by Pixie View Post
First, go to Solution Explorer, then look for the bold letters on the top, that should say your project name.
Right click on the bold text, and click properties, then go to settings.
You will need to add 2 settings.

For the first one, the name will be:
Code:
username
And the value will be empty.

For the second one, the name will be:
Code:
password
And the value will be empty.

Now for the code:

Checkbox1:
Code:
If CheckBox1.Checked = True Then
My.Settings.username = TextBox1.Text
My.Settings.password = TextBox2.Text
Form2.Show
Me.Hide
Else
Form2.Show
Me.Hide
Then for the button that inserts the username and password:

Button2:
Code:
TextBox1.Text = My.Settings.username
TextBox2.Text = My.Settings.password
With this message I would add a forget me checkbox also. Because it is all out easier.

Put this

Code:
If CheckBox2.Checked = True Then
            My.Settings.username = ("")
            My.Settings.password = ("")
        End If
Quote Originally Posted by Marthz View Post
With this message I would add a forget me checkbox also. Because it is all out easier.

Put this

Code:
If CheckBox2.Checked = True Then
            My.Settings.username = ("")
            My.Settings.password = ("")
        End If
Meh... Not needed.
Quote Originally Posted by NextGen1 View Post
Meh... Not needed.
How is it not needed? The guy might need it. On my first login program I needed it, and had a hard time figuring it out.

Oh also you have to add that to a button. Not the checkbox.

You can add this code to just make it one button. Like Login, just add this to the login buttons code.

Code:
If CheckBox2.Checked = True Then
            My.Settings.username = ("")
            My.Settings.password = ("")
            Checkbox1.Enabled = False
       Else If
If Checkbox2.Checked = False Then
            Checkbox1.Enabled = True
        End If
If CheckBox1.Checked = True Then
            My.Settings.username = TextBox1.Text
            My.Settings.password = TextBox2.Text
            Checkbox2.Enabled = False
         Else If
If Checkbox1.Checked = False Then
            Checkbox2.Enabled = True
        End If
dont get the point of button 2
Quote Originally Posted by Dreamer View Post
dont get the point of button 2
Button2 inserts the settings, which are the username and password
Quote Originally Posted by Pixie View Post


Button2 inserts the settings, which are the username and password

really!?... as if basic wasn't basic enough, that needed an explanation....... I quit!
Pixie figured he was on a roll.... why not create some form of redundancy...
A.



Your code lacks that of a Microsoft MVP,

Example, Use Else statement not if , if , if , if , if , if , that's the mark of a choob, overall point is , Pixie's code is sufficient and working, The OP never came back and claimed it wasn't , so your post was pointless.

and your double posted, Don't put a MVP stamp in your sig if you didn't get MVP (which is apparent)
I was adding to pixies as for he did not have that put in there dip. It was just if he wanted it. Pixies did not have a forget me. Just a remember. Some people want it to forget also. So I added that incase he wanted it. I never said Pixies was inefficient or anything. I just added a forget me. Maybe you need to learn to read and read what I put, and what Pixie had.
Quote Originally Posted by Marthz View Post
I was adding to pixies as for he did not have that put in there dip. It was just if he wanted it. Pixies did not have a forget me. Just a remember. Some people want it to forget also. So I added that incase he wanted it. I never said Pixies was inefficient or anything. I just added a forget me. Maybe you need to learn to read and read what I put, and what Pixie had.
I was more commenting on the fact that the OP made this post almost a week ago, and there is no reason to bump (with pointless information, IMO,) a week later, it was settled, and double posting ... no less.
Quote Originally Posted by NextGen1 View Post
I was more commenting on the fact that the OP made this post almost a week ago, and there is no reason to bump (with pointless information, IMO,) a week later, it was settled, and double posting ... no less.
I didn't really look at the date it was posted. It was in the first 10-ish posts area. So I assumed it was a fairly new post.
Quote Originally Posted by Marthz View Post
I didn't really look at the date it was posted. It was in the first 10-ish posts area. So I assumed it was a fairly new post.
I wish, VB section has been lacking lately (in members) and topics, So alot of us are working on tuts etc to increase the section a bit.
Quote Originally Posted by NextGen1 View Post
I wish, VB section has been lacking lately (in members) and topics, So alot of us are working on tuts etc to increase the section a bit.
Ok, I"ll add some tutorials if I can think of anything to make.
Posts 1–15 of 17 · Page 1 of 2
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Need help?