Support Forums

Full Version: Question about VB
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
How can I make my program remember the information typed into two textboxes by the click of a checkbox?
Thank you!
Urmmm *puts thinking cap on*....

Been a long time since I coded something in VB but i THINK this is correct...

You need to create 2 new settings, 1 for each textbox.
(I'm assuming its password & username you are wanting to remember)
So name them pass & user

The code If i remember correctly is something like this
Code:
If checkbox1.checked = true then
my.settings.user = textbox1.text
my.settings.pass = textbox2.text
my.settings.save()
End if
(06-11-2010, 01:50 AM)Dubstep Wrote: [ -> ]Urmmm *puts thinking cap on*....

Been a long time since I coded something in VB but i THINK this is correct...

You need to create 2 new settings, 1 for each textbox.
(I'm assuming its password & username you are wanting to remember)
So name them pass & user

The code If i remember correctly is something like this
Code:
If checkbox1.checked = true then
my.settings.user = textbox1.text
my.settings.pass = textbox2.text
my.settings.save()
End if

Thanks, but that's what I was using before...didn't seem to work.
Code:
Private Sub Form1_load
                My.Settings.User = TextBox1.Text
                My.Settings.Pass = TextBox2.Text
End Sub

Private Sub Button_Click
   If CheckBox1.Checked = True Then
                My.Settings.User = TextBox1.Text
                My.Settings.Save()
                My.Settings.Reload()
                My.Settings.Pass = TextBox2.Text
                My.Settings.Save()
                My.Settings.Reload()
   End If
End Sub

This should work for you.
Ok, I'll try again. By the way, this is for my MSN unfreezer. It's also HWID protected and has a built in updater. Big Grin