?
Solved

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

Posted on 2007-11-29
2
Medium Priority
?
171 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 70

Expert Comment

by:Éric Moreau
ID: 20379495
0
 
LVL 28

Accepted Solution

by:
iboutchkine earned 2000 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Article by: jpaulino
XML Literals are a great way to handle XML files and the community doesn’t use it as much as it should.  An XML Literal is like a String (http://msdn.microsoft.com/en-us/library/system.string.aspx) Literal, only instead of starting and ending with w…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Suggested Courses

770 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