Jump to content


Check out our Community Blogs

Register and join over 40,000 other developers!


Recent Status Updates

View All Updates

Photo
- - - - -

[Help]Save value in textbox?


  • Please log in to reply
4 replies to this topic

#1 neraniggy

neraniggy

    CC Lurker

  • Just Joined
  • Pip
  • 7 posts

Posted 29 August 2010 - 03:45 PM

Hello Everyone!

I have a textbox, and a checkbox next too it.
If i type "codecall" in the textbox and then i click on checkbox
I want it too save the value in textbox so next time i open the
application it is there.. Do anyone know how too do this?
I bet it is pretty simple but Im new too programming, and I looked everywhere for answers too my question.
I hope someone could help me or someone has a link that helps me.
[VB.net]



Thanks everyone.
  • 0

#2 neraniggy

neraniggy

    CC Lurker

  • Just Joined
  • Pip
  • 7 posts

Posted 30 August 2010 - 09:35 AM

help?
  • 0

#3 anotheruser

anotheruser

    CC Regular

  • Just Joined
  • PipPipPip
  • 44 posts

Posted 31 August 2010 - 03:09 AM

When you close the application any data it collected is deleted. If you want to save a value for the next time you use the application you need to save it in a file and then read it out again next time.

you can use the File class in System.IO for this. You will need to define where to save the file and how to write into and read out of it.
  • 0

#4 Vswe

Vswe

    CC Leader

  • Expert Member
  • PipPipPipPipPipPipPip
  • 1989 posts
  • Programming Language:Java, C#, PHP, Python, JavaScript, PL/SQL, Visual Basic .NET, Lua, ActionScript

Posted 31 August 2010 - 05:32 AM

When you close the application any data it collected is deleted. If you want to save a value for the next time you use the application you need to save it in a file and then read it out again next time.

you can use the File class in System.IO for this. You will need to define where to save the file and how to write into and read out of it.


Or save the value as a setting in the registry. Anyways the problem has been solved through private messages.
  • 0

#5 blindtrevor

blindtrevor

    CC Lurker

  • Just Joined
  • Pip
  • 6 posts

Posted 17 September 2010 - 05:26 AM

You can savve settings like this inside the EXE.

Try taking a look at my.settings

You need to go into "My Project" (in the sollution explorer window) and then click on the settings tab to set up all your different settings.

Then you can say something like:
for example, if you created a new setting called strTextBox...
My.Settings.strTextBox = TextBox1.text
My.Settings.Save
Then in the form.load section you can put:
TextBox1.text = My.Settings.strTextBox

there's no need to put things in the registry if you can help it :)

Any probelms, give me a shout :)


Andrew
  • 0




Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download