1.11M Members

GetSetting + SaveSetting

 
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???

 
0
 

Get Setting:

MySettingValue = My.Settings.Default.SettingName

Save Setting:

My.Settings.Default.SettingName = ConnString
My.Settings.Save()
 
0
 

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

 
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 six months: Start a new discussion instead
Post:
Start New Discussion
Tags Related to this Article