Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 757613
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T15:23:02+00:00 2026-05-14T15:23:02+00:00

How to save user inputed value in a TextBox? (WPF XAML) So in my

  • 0

How to save user inputed value in a TextBox? (WPF XAML) So in my xaml window I have a TextBox. A User starts my application, inputs some values into it and presses a button or hits Enter. He closes the app, opens it up again. How to make his inputs to be saved in that TextBox in WPF?

  • 1 1 Answer
  • 1 View
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T15:23:03+00:00Added an answer on May 14, 2026 at 3:23 pm

    You can use the built in .net settings.

    In visual studio, right click on your project and choose Add new item. From the dialog, select “Settings file”, and give it a name like “MySettings”. Visual studio will create a few files including a MySettings class with some static methods to provide you access to your settings.

    If you open this file up, you will be given a nice grid ui that allows you to enter some settings, set their type (in this case String) and set a default value. It also allows you to specify if they are application or user settings.

    • Application settings: Cannot be modified after the app has started. Can only be configued by editing an xml .config file. Will be the same for every user who runs the app.
    • User settings: Can be modified and saved while the application is running. Will be stored in the users documents and settings\username\local settings folder. Can be different for every user.

    For what you are describing, choose “User” for the scope.

    Now, to access the value in code:

    // Load the value into the text box.
    txtBox1.text = MySettings.Default.SomeSetting;
    

    and to save a change:

    // Update the value.
    MySettings.Default.SomeSetting = txtBox1.text;
    
    // Save the config file.
    MySettings.Default.Save();
    

    There’s more information about all of this on MSDN here, and there is more information on the ApplicationSettingsBase class here.

    (Obviously, if you are using mvvm, or any other UI pattern you can adapt this code to load the settings values into your model/viewmodels whenever it’s appropriate rather than directly into the text box)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Introductory Example This code Properties.Settings.Default.MyUserSettingBlah = some new value; Properties.Settings.Default.Save(); saves the user.config file
I need to save a user's login information in encrypted form for this application
I want to open a save file dialog, have the user enter a filename,
I have a btnSave_Click() function in my code-behind. If a user clicks the save
I want to save user image into a database in C#. How do I
What is the common approach to save user's inputed data: 1. Overriding onPause() method
For an application, I need to save user logs that come in different formats,
What is the recommended location to save user preference files? Is there a recommended
I would like to save data in cookies (user name, email address, etc...) but
I would like to save the programs settings every time the user exits the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.