Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. How to save latest input?

How to save latest input?

Scheduled Pinned Locked Moved Visual Basic
tutorialquestion
6 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    LordLothar
    wrote on last edited by
    #1

    If this time i enter textbox1.text = "Company Name" Next time when i open my application the textbox1.text default will be appear that "CoOmpany Name" again and not empty textbox1.text

    S Y 2 Replies Last reply
    0
    • L LordLothar

      If this time i enter textbox1.text = "Company Name" Next time when i open my application the textbox1.text default will be appear that "CoOmpany Name" again and not empty textbox1.text

      Y Offline
      Y Offline
      Yulianto
      wrote on last edited by
      #2

      You can save that in a file setting or in the registry. The next time your application start, read and show that value.


      Work hard, Work effectively.

      1 Reply Last reply
      0
      • L LordLothar

        If this time i enter textbox1.text = "Company Name" Next time when i open my application the textbox1.text default will be appear that "CoOmpany Name" again and not empty textbox1.text

        S Offline
        S Offline
        syed saba
        wrote on last edited by
        #3

        Add this following line into Command button click event or in LostFocus Event of TextBox: SaveSetting "ApplicationName", "Section", "Key" Add this line in form Load Event: TextBox = GetSetting("ApplicationName", "Section", "Key")

        L 1 Reply Last reply
        0
        • S syed saba

          Add this following line into Command button click event or in LostFocus Event of TextBox: SaveSetting "ApplicationName", "Section", "Key" Add this line in form Load Event: TextBox = GetSetting("ApplicationName", "Section", "Key")

          L Offline
          L Offline
          LordLothar
          wrote on last edited by
          #4

          Can explain it step by step? thx

          M 1 Reply Last reply
          0
          • L LordLothar

            Can explain it step by step? thx

            M Offline
            M Offline
            MohammadAmiry
            wrote on last edited by
            #5

            Hi I think syed saba was clear enoughm but I explain him a little more for you: Write:

            Private Sub Text1_LostFocus()
            call SaveSettings( "YOUR APPLICATION NAME", "SAVEDVALUES", "TEXT1VALUE", Text1.Text)
            End Sub

            Private Sub Form1_Load()
            Text1.Text = GetSettings( "YOUR APPLICATION NAME", "SAVEDVALUES", "TEXT1VALUE" )
            End Sub

            Remember that ANY string that I wrote in CAPITAL LETTERS, is any optional string that you may choose yourself. need more help?

            L 1 Reply Last reply
            0
            • M MohammadAmiry

              Hi I think syed saba was clear enoughm but I explain him a little more for you: Write:

              Private Sub Text1_LostFocus()
              call SaveSettings( "YOUR APPLICATION NAME", "SAVEDVALUES", "TEXT1VALUE", Text1.Text)
              End Sub

              Private Sub Form1_Load()
              Text1.Text = GetSettings( "YOUR APPLICATION NAME", "SAVEDVALUES", "TEXT1VALUE" )
              End Sub

              Remember that ANY string that I wrote in CAPITAL LETTERS, is any optional string that you may choose yourself. need more help?

              L Offline
              L Offline
              LordLothar
              wrote on last edited by
              #6

              I mean the SaveSettings and GetSettings im not really understand it. They are not vb.net default code right? I got it underlined and "name saveSettings is not declared".

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups