[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Resetting default value of text box at runtime – VB.Net, Visual Studio 2003, Windows Applications.

Posted on 2007-04-06
4
Medium Priority
?
276 Views
Last Modified: 2011-09-20
Hello

I’d like to have a user open my .exe Windows Application, type some text in a text box, hit a button which makes this text it’s default the next time the user opens the applications.

Is this possible without storing the default text in a text file?

Any suggestions would be appreciated.

Thanks.
Iain
0
Comment
Question by:IainTheVBALearner
[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
4 Comments
 
LVL 67

Accepted Solution

by:
sirbounty earned 320 total points
ID: 18864840
You can store it in the AppSettings...

See: http://www.codeproject.com/netcf/cConfig.asp
0
 
LVL 3

Expert Comment

by:r1937
ID: 18867308
I'm not sure about VB2003
however In VS2005 you can double click "My Project" and in settings, type in the setting name, type and scope (per user or for all users).

To access/set these values:

My.Settings.MySetting = "Test Value"

These will be saved when the application closes if save my setings on shutdown is checked or use
My.Settings.Save
0
 
LVL 3

Assisted Solution

by:r1937
r1937 earned 180 total points
ID: 18867369
Or use registry to save application.

Imports Microsoft.Win32
to open----------
        Dim RegKey As RegistryKey
        Try
            RegKey = Registry.CurrentUser.OpenSubKey("SOFTWARE\MyAppName", True)
            txtName.Text = RegKey.GetValue("Name")
            txtAddress.Text = RegKey.GetValue("Address")
            txtTelNo.Text = RegKey.GetValue("TelNo")
        Catch
            'No Registry Entries
        End Try
to save----------
           Try
                RegKey = Registry.CurrentUser.OpenSubKey("SOFTWARE", True)
                RegKey.CreateSubKey("MyAppName")
                RegKey = Registry.CurrentUser.OpenSubKey("SOFTWARE\MyAppName", True)
                RegKey.SetValue("Name", txtName.Text)
                RegKey.SetValue("Address", txtAddress.Text)
                RegKey.SetValue("TelNo", txtTelNo.Text)
            Catch
                MsgBox("Error")
            End Try
0
 
LVL 3

Author Comment

by:IainTheVBALearner
ID: 18910231
What a palava....thanks for the comments!
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying 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

Since .Net 2.0, Visual Basic has made it easy to create a splash screen and set it via the "Splash Screen" drop down in the Project Properties.  A splash screen set in this manner is automatically created, displayed and closed by the framework itsel…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Suggested Courses

656 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