Solved

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

Posted on 2007-11-29
2
165 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 69

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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Suggested Solutions

A while ago, I was working on a Windows Forms application and I needed a special label control with reflection (glass) effect to show some titles in a stylish way. I've always enjoyed working with graphics, but it's never too clever to re-invent …
It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

758 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now