-
Mar 19th, 2012, 04:30 PM
#1
Thread Starter
Lively Member
save data textboxes
dear forum users
i am making a program with multiple textboxes (60). the user needs to fill in all the 60 textboxes and i want to save them so the user doesn't need to fill in all the 60 textboxes everytime he starts the program.
my idea is to make a combolist so the user can select his own 60 boxes after he filled it once and saved it
i hope my question is pretty clear
greeting Pieter
-
Mar 19th, 2012, 04:44 PM
#2
Re: save data textboxes
It would depend on some other things, but if the issue is that the contents of the textboxes must persist between sessions, you may look into Settings. Of course, creating 60 settings and then populating them is a bit of a lot of work, but you would not need to manage any files directly on disk. This will persist from session to session but only for each specific windows user.
To create the settings go Project - Project Properties - Settings And put them one by one: name(Your desired name, in this example: String01, String02, String03, ...), Type (String), Scope (User), no need to put a Value here.
Then on your code you will do this everytime the form is opened:
vb.net Code:
With My.Settings
TextBox1.Text = .String01
TextBox2.Text = .String02
TextBox3.Text = .String03
TextBox4.Text = .String04
End With
At the end, when you are exiting the form do the oposite:
vb.net Code:
With My.Settings
.String01 = TextBox1.Text = .String01
.String02 = TextBox2.Text = .String01
.String03 = TextBox3.Text = .String01
.String04 = TextBox4.Text = .String01
End With
More important than the will to succeed, is the will to prepare for success.
Please rate the posts, your comments are the fuel to keep helping people
-
Mar 19th, 2012, 04:52 PM
#3
Re: save data textboxes
If all that is required is to save the textbox value and reload on startup then this requires no code. Property bind it.
Select Control - Properties -Application Settings - Propertie Bind - (...) - Text - New - Name
then we are done.
-
Mar 19th, 2012, 05:20 PM
#4
Thread Starter
Lively Member
Re: save data textboxes
wow thanks for the fast reply!
the my.settings works for me but now i want to make it nice for the user.
so i need to make "folders" with textbox set1, textbox set 2, ect
so the user only needs to select the textboxset and it will be filled in automaticly. is there a way to that?
i prefer data source binder ect because i didn't used that and i like to know it a little bit better
i am going to try ident his idea now
edit: i dont even know what you mean with control :'(
i feel stupid XD
your idea sound very simple so can you help me with that?
-
Mar 19th, 2012, 05:23 PM
#5
Re: save data textboxes
The textbox will be filled at startup like i said. A textbox is a control. Select the textbox and properties then follow the steps i laid out. You dont need to make any folder.
-
Mar 19th, 2012, 05:30 PM
#6
Re: save data textboxes
What ident sugested is a variation of what I said, it also uses My.Settings. With two improvements: 1st you can create the settings while assigning them, and you only need to do it once in the UI. 2nd, no need to put code to keep the textbox (contro) linked to the settings.
What Ident means by "control" is that you need to select the textBox, then go to the properties window, search for Application Settings (usually the first one), click on it to expand and select PropertyBinding, then click on the (...), on the window that appears, select Text, inside it select "New", and give the property a name.
Since you would need to do this for each one of the 60 textBoxes I suggest you create one and then make copies, it will be much easier to change the name of the setting than to have to do all those steps.
More important than the will to succeed, is the will to prepare for success.
Please rate the posts, your comments are the fuel to keep helping people
-
Mar 19th, 2012, 05:48 PM
#7
Thread Starter
Lively Member
Re: save data textboxes
aha now i understand sorry i am very new in programming
but that is not exectly what i wanted, now it goes further were you ended right?
i want to let them fill in 60 textboxes and than let them have the option to save the textboxes to that string01 but if they start the app the next time they can make anotherone. so they can make there own data base with there own textbox sets.
thanks for the reply
for example:
if textboxset1 is selected
textbox1.text = hello
if textboxset2 is selected
textbox1.text = goodbye
Last edited by spiedey; Mar 19th, 2012 at 06:02 PM.
-
Mar 20th, 2012, 03:12 PM
#8
Thread Starter
Lively Member
-
Mar 20th, 2012, 03:55 PM
#9
Re: save data textboxes
So what you are asking for is difference profile settings? 60 textboxes saved each time or reloaded depending on what profile the user is asking for.
-
Mar 21st, 2012, 03:22 AM
#10
Thread Starter
Lively Member
Re: save data textboxes
exectly
sorry if i am very unclear
Tags for this Thread
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
|