|
-
Jun 10th, 2010, 10:58 PM
#1
Thread Starter
Lively Member
[RESOLVED] Remembering Text.
So I want to create a small notepad, that on closure, saves whatever is in the noetpad without a prompt, and when opened, displays in the notepad what was in it before it closed.
Can anyone help me with this? The notepad is just a simple TextBox.
Thanks in Advance guys .
-
Jun 10th, 2010, 11:11 PM
#2
Re: Remembering Text.
you could use (ApplicationSettings):
1/ select your textbox in your design time form
2/ expand (ApplicationSettings) in your properties window
3/ select (PropertyBindings) + click the ellipsis to the right
4/ select the text property in the dialog + click the dropdown arrow to the right
5/ click New in the dropdown menu + type in a name for the property in the New Application Setting window
6/ click OK on the New Application Setting window
7/ click OK on the Application Settings window
- Coding Examples:
- Features:
- Online Games:
- Compiled Games:
-
Jun 10th, 2010, 11:14 PM
#3
Re: Remembering Text.
may be you can use Settings like this:
Code:
Private Sub Form1_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
My.Settings("Notepad") = TextBox1.Text
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
TextBox1.Text = My.Settings("Notepad")
End Sub
__________________
Rate the posts that helped you 
-
Jun 10th, 2010, 11:23 PM
#4
Re: Remembering Text.
 Originally Posted by riteshjain1982
may be you can use Settings like this:
Code:
Private Sub Form1_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
My.Settings("Notepad") = TextBox1.Text
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
TextBox1.Text = My.Settings("Notepad")
End Sub
@riteshjain1982 - you forgot to mention that you need to add a my.settings string setting named Notepad to use that method
- Coding Examples:
- Features:
- Online Games:
- Compiled Games:
-
Jun 10th, 2010, 11:25 PM
#5
Re: Remembering Text.
 Originally Posted by .paul.
@riteshjain1982 - you forgot to mention that you need to add a my.settings string setting named Notepad to use that method
thanks for correction
__________________
Rate the posts that helped you 
-
Jun 10th, 2010, 11:51 PM
#6
Thread Starter
Lively Member
Re: Remembering Text.
It's all working.
Thanks for the help Paul.
-
Jun 16th, 2010, 04:15 PM
#7
Lively Member
Re: Remembering Text.
 Originally Posted by .paul.
@riteshjain1982 - you forgot to mention that you need to add a my.settings string setting named Notepad to use that method
how do you do that?
-
Jun 16th, 2010, 04:46 PM
#8
Re: [RESOLVED] Remembering Text.
Project-->Properties-->Settings, + you can probably work it out from there...
- Coding Examples:
- Features:
- Online Games:
- Compiled Games:
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|