Support Forums
Question about VB - Printable Version

+- Support Forums (https://www.supportforums.net)
+-- Forum: Categories (https://www.supportforums.net/forumdisplay.php?fid=87)
+--- Forum: Coding Support Forums (https://www.supportforums.net/forumdisplay.php?fid=18)
+---- Forum: Visual Basic and the .NET Framework (https://www.supportforums.net/forumdisplay.php?fid=19)
+---- Thread: Question about VB (/showthread.php?tid=7721)



Question about VB - Đενɨаηсε™ - 06-10-2010

How can I make my program remember the information typed into two textboxes by the click of a checkbox?
Thank you!


RE: Question about VB - Fragma - 06-11-2010

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



RE: Question about VB - Đενɨаηсε™ - 06-11-2010

(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.


RE: Question about VB - Fragma - 06-11-2010

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.


RE: Question about VB - Đενɨаηсε™ - 06-11-2010

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