Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Question about VB
#1
How can I make my program remember the information typed into two textboxes by the click of a checkbox?
Thank you!
Reply
#2
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
Reply
#3
(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.
Reply
#4
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.
Reply
#5
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
Reply


Forum Jump:


Users browsing this thread: 6 Guest(s)