| View previous topic :: View next topic |
| Author |
Message |
jason744 Grandmaster Cheater
Reputation: 0
Joined: 25 Nov 2007 Posts: 638
|
Posted: Mon Mar 10, 2008 3:17 pm Post subject: Saving Settings of RadioButtons |
|
|
This is what I tried and guessed.
| Code: | Private Sub Form2_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
My.Settings.RadioButton1 = Me.RadioButton1.Checked
My.Settings.RadioButton2 = Me.RadioButton2.Checked
My.Settings.RadioButton3 = Me.RadioButton3.Checked
If Me.RadioButton1.Checked = True Then
My.Settings.RadioButton1 = True
My.Settings.RadioButton2 = False
My.Settings.RadioButton3 = False
End If
If Me.RadioButton2.Checked = True Then
My.Settings.RadioButton2 = True
My.Settings.RadioButton3 = False
My.Settings.RadioButton1 = False
End If
If Me.RadioButton1.Checked = True Then
My.Settings.RadioButton2 = False
My.Settings.RadioButton3 = False
My.Settings.RadioButton1 = True
End IF
End Sub |
Apparently it's not working. can someone help a bit?
|
|
| Back to top |
|
 |
AndrewMan Grandmaster Cheater Supreme
Reputation: 0
Joined: 01 Aug 2007 Posts: 1257
|
Posted: Mon Mar 10, 2008 3:25 pm Post subject: |
|
|
What exactly are you trying to do?
_________________
|
|
| Back to top |
|
 |
jason744 Grandmaster Cheater
Reputation: 0
Joined: 25 Nov 2007 Posts: 638
|
Posted: Mon Mar 10, 2008 3:28 pm Post subject: |
|
|
| Saving the choice the user made so it doesnt go back to the default I chose in designer properties.
|
|
| Back to top |
|
 |
GordonBM Expert Cheater
Reputation: 0
Joined: 06 Jul 2007 Posts: 205
|
Posted: Mon Mar 10, 2008 3:29 pm Post subject: |
|
|
Means it saves the options you set before you close the form.
_________________
| maxuer wrote: |
:p What is a memory scanner and where I found one? |
|
|
| Back to top |
|
 |
OSIRIS Grandmaster Cheater
Reputation: 0
Joined: 27 Aug 2006 Posts: 654
|
Posted: Mon Mar 10, 2008 3:38 pm Post subject: |
|
|
You could use a textfile or something. So when the form closes it rights the data to it. Then would read it when it loads up.
Something like this.
FORM CLOSE:
| Code: | if radio2 is selected then
text2.txt.line2=2
|
|
|
| Back to top |
|
 |
jason744 Grandmaster Cheater
Reputation: 0
Joined: 25 Nov 2007 Posts: 638
|
Posted: Mon Mar 10, 2008 3:39 pm Post subject: |
|
|
Nevermind, Got it to work. Request for lock.
If anyone whats to know its:
| Code: | Private Sub Form2_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
My.Settings.RadioButton1 = RadioButton1.Checked
My.Settings.RadioButton2 = RadioButton2.Checked
My.Settings.RadioButton3 = RadioButton3.Checked
My.Settings.Save()
End Sub |
| Code: | Private Sub Form2_Shown(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Shown
RadioButton1.Checked = My.Settings.RadioButton1
RadioButton2.Checked = My.Settings.RadioButton2
RadioButton3.Checked = My.Settings.RadioButton3
End Sub |
|
|
| Back to top |
|
 |
AndrewMan Grandmaster Cheater Supreme
Reputation: 0
Joined: 01 Aug 2007 Posts: 1257
|
Posted: Mon Mar 10, 2008 3:40 pm Post subject: |
|
|
I never even knew you could do this with VB 2008. More codes for me to learn
_________________
|
|
| Back to top |
|
 |
jason744 Grandmaster Cheater
Reputation: 0
Joined: 25 Nov 2007 Posts: 638
|
Posted: Mon Mar 10, 2008 3:45 pm Post subject: |
|
|
| AndrewMan wrote: | I never even knew you could do this with VB 2008. More codes for me to learn  |
Well first you'll have to go to my project, settings tab, make your settings, change them to booleans if its radiobutton or checkbox stuff like that.
|
|
| Back to top |
|
 |
OSIRIS Grandmaster Cheater
Reputation: 0
Joined: 27 Aug 2006 Posts: 654
|
Posted: Mon Mar 10, 2008 3:46 pm Post subject: |
|
|
All you did was that to save your seetings
| Code: |
My.Settings.RadioButton1 = RadioButton1.Checked
My.Settings.RadioButton2 = RadioButton2.Checked
My.Settings.RadioButton3 = RadioButton3.Checked
My.Settings.Save()
|
|
|
| Back to top |
|
 |
jason744 Grandmaster Cheater
Reputation: 0
Joined: 25 Nov 2007 Posts: 638
|
Posted: Mon Mar 10, 2008 3:56 pm Post subject: |
|
|
| mageknight wrote: | All you did was that to save your seetings
| Code: |
My.Settings.RadioButton1 = RadioButton1.Checked
My.Settings.RadioButton2 = RadioButton2.Checked
My.Settings.RadioButton3 = RadioButton3.Checked
My.Settings.Save()
|
|
And the one where you declare the settings are related to the checked property of radiobuttons.
I'm planning on having about 20 more. Oh boy.
|
|
| Back to top |
|
 |
AndrewMan Grandmaster Cheater Supreme
Reputation: 0
Joined: 01 Aug 2007 Posts: 1257
|
Posted: Mon Mar 10, 2008 3:57 pm Post subject: |
|
|
| jason744 wrote: | | mageknight wrote: | All you did was that to save your seetings
| Code: |
My.Settings.RadioButton1 = RadioButton1.Checked
My.Settings.RadioButton2 = RadioButton2.Checked
My.Settings.RadioButton3 = RadioButton3.Checked
My.Settings.Save()
|
|
And the one where you declare the settings are related to the checked property of radiobuttons.
I'm planning on having about 20 more. Oh boy. |
What are the "20" for?! How are you going to have 20 items lol. Are you making like 20 applications that you open? Just make customizable buttons like I did.
| Code: |
Button1.Text = InputBox("Set name here") |
_________________
|
|
| Back to top |
|
 |
jason744 Grandmaster Cheater
Reputation: 0
Joined: 25 Nov 2007 Posts: 638
|
Posted: Mon Mar 10, 2008 4:01 pm Post subject: |
|
|
| That doesn't look as good as radiobuttons. ^^
|
|
| Back to top |
|
 |
AndrewMan Grandmaster Cheater Supreme
Reputation: 0
Joined: 01 Aug 2007 Posts: 1257
|
Posted: Mon Mar 10, 2008 4:13 pm Post subject: |
|
|
| jason744 wrote: | | That doesn't look as good as radiobuttons. ^^ |
Checkmarks are sexier.
_________________
|
|
| Back to top |
|
 |
jason744 Grandmaster Cheater
Reputation: 0
Joined: 25 Nov 2007 Posts: 638
|
Posted: Mon Mar 10, 2008 4:18 pm Post subject: |
|
|
| AndrewMan wrote: | | jason744 wrote: | | That doesn't look as good as radiobuttons. ^^ |
Checkmarks are sexier. |
I could change it to check marks anytime.
Request Lock.
|
|
| Back to top |
|
 |
atom0s Moderator
Reputation: 205
Joined: 25 Jan 2006 Posts: 8587 Location: 127.0.0.1
|
Posted: Mon Mar 10, 2008 4:52 pm Post subject: |
|
|
| jason744 wrote: | I could change it to check marks anytime.
Request Lock. |
Locked.
_________________
- Retired. |
|
| Back to top |
|
 |
|