Solved

What is the proper syntax when using My.Settings to save information?

Posted on 2007-11-29
2
169 Views
Last Modified: 2010-04-23
I am trying to save the text typed into a text box when a profram closes.  I would also like to have it back in the textbox when I load the form.  It is a variable because when running the application it can change. i'm not looking for a default setting.

My.Settings.Item = textbox.text in the form_closing event   and

textbox.text = My.Settings.Item in the form_load event.

The above doesn't work, looking for ideas.  I am very new at Visual basic.
0
Comment
Question by:markleszczynski
2 Comments
 
LVL 70

Expert Comment

by:Éric Moreau
ID: 20379495
0
 
LVL 28

Accepted Solution

by:
iboutchkine earned 500 total points
ID: 20381747
'read
    Private Sub startBtn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles startBtn.Click
        MsgBox(My.Settings.Color)
    End Sub

'write
    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        My.Settings.Color = "Red"
        My.Settings.Save()
    End Sub
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Well, all of us have seen the multiple EXCEL.EXE's in task manager that won't die even if you call the .close, .dispose methods. Try this method to kill any excels in memory. You can copy the kill function to create a check function and replace the …
Article by: Kraeven
Introduction Remote Share is a simple remote sharing tool, enabling you to see, add and remove remote or local shares. The application is written in VB.NET targeting the .NET framework 2.0. The source code and the compiled programs have been in…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question