1,105,320 Community Members

GetSetting + SaveSetting

Member Avatar
ruchika beddy
Light Poster
35 posts since Apr 2008
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

Below is the code in VB. I want GetSetting + SaveSetting in VB.Net---


VB
Call SaveSetting(App.ProductName, App.title, "CheckBox1", values)

call CheckBox1.value=GetSetting(App.Productname,App.title,"CheckBox1",VbUnChecked)


VB.Net

Call SaveSetting(Application.ProductName, Application.ProductName, "CheckBox1", values)
Abive SaveSetting is rite or not???
Secomdly. what is the code gor GetSetting???

Member Avatar
asnider
Newbie Poster
23 posts since Jul 2008
Reputation Points: 2 [?]
Q&As Helped to Solve: 2 [?]
Skill Endorsements: 0 [?]
 
0
 

Get Setting:

MySettingValue = My.Settings.Default.SettingName

Save Setting:

My.Settings.Default.SettingName = ConnString
My.Settings.Save()
Member Avatar
ruchika beddy
Light Poster
35 posts since Apr 2008
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

I dont thnik so dat ur reply does dat which i want..

Member Avatar
iSoftware
Newbie Poster
5 posts since Jul 2008
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

Please work on your spelling :) It will make things a lot easier to understand.

Note that you don't have to use "Call" every time in VB.NET. Secondly, you aren't using the function right.

Say, on form closing, you want it to save the value of the check box and on next start you want it to retain its value. You would do this.

I wrote this code from the top of my head- I don't know if it works or not. I'm in a bit of a hurry, so I can't check if it works.

Private Sub Form1_Closing(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.FormClosing
    ' Save the checkbox's value to the registry
    SaveSetting(Application.ProductName, Application.ProductName, "CheckBox1", CheckBox1.Checked)
End Sub

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    ' Get checkbox value
    CheckBox1.Checked = GetSetting(Application.ProductName, Application.ProductName, "CheckBox1")
End Sub
You
This article has been dead for over three months: Start a new discussion instead
Post:
Start New Discussion
Tags Related to this Article