Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    Visual Basic




Function To Save/load Data From All Textboxes Into Registry With Save/GetSetting?


anyone have a function to save all values to the registry?




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Registry Use - Save/Getsetting()
I have a small app, and I want the user to be able to set (save)
default settings.

I know I can achieve this by using an .ini/txt file, however I'd thought I'd give the registry a ago.

I have 8 .text (numbers) to save.
ie: 60,10,2185,2143,2045,3000,3627,0
all from the same 'form'.

I havn't accessed the registry before and I am
a little concerned.

I have searched vb2 and looked in my ref manuals, however
I can't seem to find what I want to do.

Can someone please provide an example!

Cheers,
Bruce.

How To Use The Registry To Save/load Simple Data?
hey all wasup

i need help!
how can i save and load simple data like names, paths etc. into the registry?
the data placed in several labels + textboxes.
i want it to save the data in the labels/textboxes into the registry. than under some function (button click or something, i'll think about it later ) i want it to load the data back into the same labels/textboxes.
for ex. if "Eric" is placed in txtName.text and "Dan" is in txtEnemy.text i want it to load "Eric" into txtName.text and "Dan" into txtEnemy.text. (may b needed to load in a diffrent form). Tnx guys
Laterz

Read/Writing To The Registry W/o Save/getsetting
Say, how does one go about writing to and reading from the registry without using savesetting and getsetting?
thanks
kevin

How To Save Multiline Textboxes To A Single File And Load Them Later?
i have 4 textboxes in an array, most are multilined..

how can isave the contents to a file, and retrieve them later?

Need Help On Load/save Function..
I need help on this to make load / save function work..

PS: you can download the exampple and work on that,much easier... But please help!!

What i need here is for the save function to save each item from the list in a new line in the "data.ads" , and for the load function
to clear the list and read each line ,correctly into the list again...
Can anyone help me??
Im stuck, cause i don't know enough...



VB Code:
Private Sub Command3_Click()List1.ClearEnd Sub Private Sub Command4_Click()    Dim ls    ls = List1.ListCount - 1    List1.ListIndex = 0   'MsgBox ls    Open App.Path & "Data.ads" For Random As #1        List1.ListIndex = ls        For e = 0 To ls        Put #1, , SplitTab(0) & vbTab & "€€" & vbTab & SplitTab(1)        Next e    Close #1End Sub Function SplitTab(nr)'If List1.ListIndex = -1 Then List1.ListIndex = 0Dim Tabs() As StringTabs = Split(List1.Text, vbTab)SplitTab = Tabs(nr)End Function  Private Sub Form_Load()Dim i 'count valueList1.ClearFor i = 0 To 20List1.AddItem "ehh: " & i & vbTab & "Item: " & iNext iEnd Sub   Private Sub Command1_Click()'sort/search buttonDim fnd As IntegerDim strTemp, strTemp2List1.ListIndex = 0For fnd = 0 To List1.ListCount - 1''MsgBox fnd 'Need To AutoSelect Item In List Here'Start at first item and ending on last itemList1.ListIndex = fnd 'this gives a "invalid property value" Dim SplitTab() As StringSplitTab = Split(List1.Text, vbTab)strTemp = SplitTab(0)strTemp2 = SplitTab(1)''MsgBox strTemp 'Show you what it does 'strTemp = List1.List(fnd)If InStr(1, strTemp, Text1.Text) Then List1.RemoveItem fndList1.AddItem strTemp & vbTab & strTemp2, 0End IfNext fndList1.ListIndex = 0List1.ListIndex = -1  End Sub Private Sub Text1_Change()Text1.Text = ""End Sub

Anyone Have A Function To Load/save A Variable Into A File?
Ive been coding in vb for years.. and i STILL to this day do not get the stupid file system thing... to do something basic like load or save a variable to a file

do you use get? put? input? lof? buffers? loops? output?

ive seen so many ways, they all get mixed together..


anyone have 2 very simple function that will just load a file and save a file to a string?

thanks

Save 5 And Get 4 With Save And Getsetting
I have a very strange problem that I've never seen before
I have 5 savesettings and I use a for loop from 1 to 5 to call them out and save in a grid
I always get 4 savesettings and miss the last one
I check by add a msgbox i in the loop, then I get 5 savesetting... it seems to me that I have to put a beark in the loop in order get all 5 savesettings
I also tried diff. number of settings and the results remain the same ... always miss the last one unless I put a break in the loop
Any idea what cause this problem?
Thx, Chris

How To Save & Load An Exe's Icon With The ExtractAssociatedIcon Win32 API Function?
sups all
i need to know How to save & load an exe's icon with the ExtractAssociatedIcon Win32 API function.
can some1 help me?
tnx

Save/GetSetting
Hi,

When SaveSetting is used, where are the information stored? And how can I get this file?

Thanks.

oolala

Save And Load Data From Textboxs With XML ??
I searched the net and the forums, but have not seem true XML examples. Is there a way to save the data from text boxes as XML and then load them back? Examples would be great.

Thanks!

Load/Save Listbox Data To .txt...
How do I do this? I want the user to be able to "save as" and not just save it to a file already specified.

Save & Load Data From Excel
Hi

How can i save data to Excel & load that data in future. Say i added 10 records to excel worksheet and saved that data & closed the file. Next time i want lo load that 10 records in listview control and want add new records after 10th record.

Can anyone please give the source code or redirect me to any website.

Please Help

Save/Load Data And Treeview
Hi all,
i have a treeview and 3 textbox on my form. --->
  
 treeview
         textbox1 : Site Name
                                             textbox2 : Number
                                             textbox3 : Comment

the problem is how i'm going to save all the data with the treeview node with using only textfile. when run the program, all the data will be loaded in the textboxs follow the node that the user click.



Edited by - alucard5 on 1/18/2004 1:38:31 AM

Save/Load Treeview Node With Data
Hi all,
i have a treeview and 3 textbox on my form. --->

treeview textbox1 : Site Name
textbox2 : Number
textbox3 : Comment

the problem is how i'm going to save all the data with the treeview node with using only textfile. when run the program, all the data will be load in the textboxs follow the node that the user click.

Save And Load Data From RichTextBox Along With Formation
How to save the data from RichTextBox in memo field with formation and later load in RichTextBox along with formation?
Thanks

How To Get Save Dialog To Load Text Data

All my books do not discuss how to load  text data into a file.
the only thing covered how to load rtftext. But what if you have other kinds of data?
I am trying to use a common dialog box which is formated to use the showsave part.

Combobox: Save/GetSetting Vs Saving To File
I know that "is savesetting better than writing to INI file?" is a common question, and know the answer.
But my question is a little different: I have a combobox that is populated at runtime and I would like the program to store the data that it contains from one time to another. The ComboBox could contain several hundreds of items, so I don't want to repopulate it every time the program is run. I would like to know if I should use the savesetting/getsetting function for this or write everything to a file? Also, if I write to a file, which method should I use?
Thanks for your help and time

Treeview1 Save / Load Additional Text Data
Greetings all.

In my form that adds the node, I also have a text box for Description, weight, size, and cost. I want to be able to load / save this data as well, and wonder if it can be done without the use of a .mdb file or such. I want it to write to the same .txt file.
Now, being a complete newbie, I am thinking it may have to do with the 'Split' code, but I may be way off. I am not asking for anyone to do it for me, just some guidence or direction to an article or something. I searched MSDN, forums, and some code example and haven't found anything even close yet.

I have included my example project and gave full props to those who have helped me. Thanks to all of you that help us newbies in our time of learning!

Save To Registry Or Save To .txt Or .ini File?
Perhaps I should have posted this as a poll, but hey-ho...

Right, following on from a few points made (see thread http://www.codeguru.com/forum/showt...threadid=236942 if you are wondering where these points were made) I was wondering whether it is better to save settings such as window positions and size, and other settings specific to your application to the registry, or in a .txt or .ini file.

Personally, I have always saved all window positions and size settings (and sometimes a few other things) to the registry, and then for applications where I need a lot of settings saved I have used .txt files (provided no database is involved).

Where do you draw the line in saving information to the registry and start saving to another file? Or, do you do just one and not the other? And, are there any speed advantages in either, or is it much the same?

Thanks for any input.

Save 3 Textboxes............
I want when the user clicks on "Save As" button, it saves 3 textboxes as 1 file,and also saves the text in the textboxes as 3 different *.js files. Like a visual basic project. Please help, I'll give ratings of 10.

--Ant
--------------------------------------------------
check out my newest freeware
E-mail me at: cgeorge@thevortex.com
for the address

How To Save The Contents Of More (RTF)textboxes In One File?
Hi,

is it possible to save the contents of more textboxes, normal and RTF, in one file?
E.g. save the contents of 2 normal textboxes and 3 RTF textboxes in one file, so this one file contains the contents of all 5 textboxes.
If this can be done, how can I retrieve the contents of the 5 textboxes separately?

Thanks in advance

How Can I Save The Input From TextBoxes To A File
Hi i'm a newbie when it comes to programming, but i would really wanna learn.

I want to know how i can save the input user's give to a textbox to a txtfile.

I would really apriciate any help on this,..

Pat

How To Save The Contents Of More (RTF)textboxes In One File?
Hi,

is it possible to save the contents of more textboxes, normal and RTF, in one file?
E.g. save the contents of 2 normal textboxes and 3 RTF textboxes in one file, so this one file contains the contents of all 5 textboxes.
If this can be done, how can I retrieve the contents of the 5 textboxes separately?

Thanks in advance.

Save And Loading Text In 3 Textboxes
this is my code it work but I want to save the file in my docments and on a cammand click open my docment and let me choose which file to open is this posable?
 
Option Explicit


Private Declare Function WritePrivateProfileString Lib "kernel32" Alias "WritePrivateProfileStringA" (ByVal lpApplicationName As String, ByVal lpKeyName As Any, ByVal lpString As Any, ByVal lpFileName As String) As Long
Private Declare Function GetPrivateProfileString Lib "kernel32" Alias "GetPrivateProfileStringA" (ByVal lpApplicationName As String, ByVal lpKeyName As Any, ByVal lpDefault As String, ByVal lpReturnedString As String, ByVal nSize As Long, ByVal lpFileName As String) As Long


Private Sub Command1_Click()
Dim lngResult As Long
Dim strFileName
strFileName = App.Path & "myini.ini"
lngResult = WritePrivateProfileString("My Text", "Text 1", Text1.Text, strFileName)
lngResult = WritePrivateProfileString("My Text", "Text 2", Text2.Text, strFileName)
lngResult = WritePrivateProfileString("My Text", "Text 3", Text3.Text, strFileName)


End Sub

Private Sub Command2_Click()
Dim lngResult As Long
Dim strFileName
Dim strResult As String * 50
strFileName = App.Path & "myini.ini" 'Declare your ini file !
lngResult = GetPrivateProfileString("My Text", "Text 1", strFileName, strResult, Len(strResult), strFileName)
Text1.Text = strResult
lngResult = GetPrivateProfileString("My Text", "Text 2", strFileName, strResult, Len(strResult), strFileName)
Text2.Text = strResult
lngResult = GetPrivateProfileString("My Text", "Text 3", strFileName, strResult, Len(strResult), strFileName)
Text3.Text = strResult
End Sub



How To Save Info From Multiple Textboxes...
I'm tryin to get the text from several text and rtf boxes, format them by adding a standard phrase here and there and then saving the final thing as a *.txt or *.htm file.

For instance, textbox 1 has user input of "7", textbox 2 has user input "10", rtfbox 1 has user input "60 seconds". I want to format it to, "This individual has 7 balls, which he must juggle 10 times, in a period of 60 seconds." And then save the formated text as a txt file.

If someone could help me out, I'd appreaciate it.

Thanks.

How To Save Text From Multiple Textboxes/loading Back
Hi, I'm a total newbie because I'm mechanical engineer by profession,

I need some help:

I have :
txt1.Text
txt2.Text
.
.
.
txt9.Text

I need to save all this values into a single file (i can do this already using the CommonDialog) and then LOAD the file, read the values and reassigning/display each to its respective textboxes. ie

txt1.Text = ???
txt2.Text = ???

I don't know how to do the open/read/assign part.

Basically I'm just trying to add a 'save all input' and a 'load input from file' function in my program.

How do i do so? Simplest possible way please. Thank you.

Load/Save From/to Txt?
I'm a beginner with visual basic. i guess we could start there..

Private Sub Save1_Click()
Open (App.Path & " emp.txt") For Output As #1
variabelone = Text1.Text
Print #1, variabelone
Close #1
End Sub

These rows will save whatever text there is in "text1" to a text document called temp. Some similar rows will load whatever temp.txt containes and output that in text2.

This far no problem. I wrote this to prepare myself for the saving part in a game im programming in visual basic. The problem with this system is that, to save a game in my game, you will need at least 300 of those txt:s. And that is not an option according to me.

I know it is possible in some very easy way, but i can't find anywhere telling my how to do it:

How can i save and load information to/from a specific Row in a text document? (so i can use ONE txt-file, containing 300 rows, instead of 300 files, containing one each...)

thanks //sam

Save/load
im srry if this was posted before but how do i save/load cause im makeing a game n i want a save/load in it but i dont know how.....help plz

LV1 Save / Load
How do I save the ListView1 data in a format so I can load all the data back into the columns? I don't know how to save it or load it back into the columns. Can someone show me an example or what I should look out for?

Thanks

Silver

Save/Load
I have a text editor, where, of course, I'll want to be able to Save/Load. I have 2 command buttons in a second form which I want to be able to click to open a Save Window. Now, I have managed to make a window open that lets me type in an address to save the file at, but I would like to be able to browse and save. The same thing goes with Load. Can anybody help?

Load/Save
Hi, can anybody help me? I'd like to know how I can save and load Caption(or another properties of Label) into/from a txt file?

Save/load
i just want a button to be save and one for load and when i click save it just saves a file with everything on the list and loads that again if i click on the load button

Save/load
does anyone know the code to save/load like a video game save/load. Ex Final Fantasy 7 u know how u can save then load when ever u want. ty if u can help and still waiting on help with other problem click here

Save/Load
Why wont this work?


VB Code:
Private Sub mnufileload_Click()    Dim TheSave As Integer    'load file    Dim MyFileName As String    CommonDialog1.DialogTitle = "Open File"    On Error GoTo No_Open    CommonDialog1.ShowOpen        Open CommonDialog1.FileName For Input As #1    TheSave = Input(1, I)    Close 1    lblcash.Caption = TheSave        Exit SubNo_Open:End Sub Private Sub mnufilesave_Click()    'save file    I = lblcash.Caption    CommonDialog1.DialogTitle = "Save File"    CommonDialog1.Flags = cdlOFNOverwritePrompt    On Error GoTo No_Save    CommonDialog1.ShowSave        Open CommonDialog1.FileName For Output As #1    Write #1, I    Close 1    No_Save:End Sub


thx in advance

Using VB To Load From And Save To A XML?
I have been searching for about 6 hours and have yet to find ANYTHING about saving to / loading from a XML in VB.

Any links/help would be appreciated

Thanks,
Replex


(The XML im trying to work with can be found here: http://www.angelfire.com/empire/httpgamesq/settings.xml copy + paste if it doesnt work)

Save/Load
What is incorrect in this code?
I am trying to save a string called save in savefile.txt.
Option Explicit

Dim listadd As String
Dim save As String
Dim x As Integer

Private Sub Command1_Click()

listadd = Text1.Text
save = listadd
List1.AddItem (listadd)

End Sub

Private Sub mLoad_Click()
Open App.Path & "savefile.txt" For Input As #1
Input #1, save
List1.AddItem (save)
Close
End Sub

Private Sub mSave_Click()
Open App.Path & "savefile.txt" For Output As #1
Write #1, List1.ItemData(x)
Close
End Sub

Save And Load
I have written this timesheet application, but I have run into a snag. When you first run it, it works great. I have it set up to put a msgbox up if there are not any times to calculate. Once you save it, then load it and run it, if there a no times to calculate it gives me a mismatch error. It seems to just skip the msgbox step and give me an error. Would anyone like to take a crack at this one. I am sure it is simple enough, I'm just not seeing it. I have attached the ZIP file for anyone interested. Perhaps someone can enlighten me on a better way to do it.

Thanks, Dave

Save And Load ???
hi i got this code from a firend,

Code:Private Sub ReadFromFile()
Dim LineOfText As String
Dim i As Integer

    Open Text2.Text For Input As #1
    On Error GoTo TooBig: 'set error handler
    Do Until EOF(1) 'then read lines from file
        Line Input #1, LineOfText
        Text1(i).Text = LineOfText
        i = i + 1
    Loop

CleanUp:
    Close #1 'close file
    Exit Sub
TooBig: 'error handler displays message
    MsgBox ("The specified file is too large.")
    Resume CleanUp: 'then jumps to CleanUp routine
End Sub

Public Sub WriteToFile()
Dim i As Integer
Dim ctrl As TextBox
     
    Open Text2.Text For Output As #1
     
    For Each ctrl In form19.Text1
        Print #1, Text1(i).Text
        i = i + 1
    Next

    Close #1 'close file
End Sub

and i got no idea where it saves or loads to, the file name

can you guys help


 

Save/load
Hi all!
I wrote a piece of software and I need to insert a couple buttons that would save and load the settings. I already export all the settings to some .txt files. But what if I want to import them back and make all the checkboxes and buttons corespond to the saved settings. I have no idea on how to start on even creating the menus to save to a file and load from a file (you know, like a save and an open button in word for example). Please send me any pointers or maybe websites that have articles about this problem.
Thanks.

Save To Registry
I'm trying to save a Combo Box List in the Registry. My code creates the place in the Registry, but under Data, in the Registry there is nothing. Also I'm not sure if my code is right to load the list with Form Load. This is what I have so far. Thanks for any help.

_____________________________________________________________
Private Sub OKButton_Click()

Form1.combo.AddItem AddExercisedlg.Addtxt, AddExercisedlg.ListIndex
SaveSetting "Max Workout Program", "Exercise", "List", Form1.combo.List(Form1.combo.ListIndex)
Unload Me

End Sub
_____________________________________________________________

Sub LoadList()

GetSetting "Max Workout Program", "Exercise", "List", combo.List(combo.ListIndex)

End Sub

Want To Save Value In Registry....
Helo,
i want to save check and unchecked checkbox values in registry.plz help me.

How Can I Save Something From The Registry?
I want to know how I can save the value of a certain file from the registry...thanks

Save In Registry As A Name
I have been using this code from the API-Guide. I am new to API's in general.
It creates a REG_DWORD in the directory I want.
How do I name the entry, for example I would like to store the position of the form when it is closed, with Left, Top, Height, Width?


vb Code:
Dim Result As Long'Check if the specified key existsRegOpenKeyEx HKEY_LOCAL_MACHINE, vSubKey, 0, KEY_ALL_ACCESS, Ret'If the key doesn't exist, we create itIf Result = 0 Then    'Create a new key    RegCreateKeyEx HKEY_LOCAL_MACHINE, vSubKey, 0, "REG_DWORD", REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, ByVal 0&, Result, Ret    If Result = 0 Then        MsgBox "Error while creating the Key!!"        Exit Sub    End IfEnd If


This runs and creates the entry, but when I run the app a second time, it doesn't create another entry, so I guess I have to insert a name, or text somewhere.

Save To Registry
I need code that will save information to registry. For example, if the user clicks a check box everytime the application is loaded then the check box is ticked, however if they untick the check box it will load with the check boxes unticked.

I also need this for Option boxes, Text boxes.

Please help

Save In Registry
Here is what I have
It's should be simple


Private Sub cmdOutput_Click()

GetSetting App.Title, "FMC", "Output", Default
dlgSelectOutput.Filter = "Text Files(*.txt)|*.txt|All Files(*.*)|*.*"
dlgSelectOutput.ShowOpen
lblOutput = dlgSelectOutput.FileName
SaveSetting App.Title, "FMC", "Output", strOutputFile
End Sub


I'm trying to make it so that the dialogue box always heads to the same path even after the program has been exited.

So if I'm using the program, select a file from the desktop, and shut down my computer, the next time I come back on the dialogue box goes for the desktop instead of VB98....

Save To Registry
I need to save data to the registry. I know about the SaveSetting command but it only saves under the "VB and VBA Program Settings".

I need to save under undet this key.

[HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionRun]

I'm making a system service app and thats why i want it to load at start up.

/Anders

Save To Registry
I have some options I'd like the user to be able to set and make default for future uses of the software. I would like the settings to save to the registry when the user clicks a checkbox. Here are the vlaues I need:

Which of 2 option buttons is checked (radMale or radFemale) , the value of a combobox called 'delay', and the value of a combobox called 'scan'

please help.

Is There A Set Load And Save Window?
Hi guys, Ive made a Load window, in which you can choose ur drive and directory, and select a file but its abit ropey. so is there any set examples out there?

Cheers

How To Save/load A Game
Hiya,

I did a search of the forums, but I did not find any clear information on how to write the code for saving and/or loading a game.

Basically, I'm working on a kingdom simulator that is full of different variables, such as Treasury amount, population size, taxation level, industrial population size, etc.

I'm looking for a code that would let me save the game and also let me load it from a while later on so I can continue playing from where I left off.

Any suggestions?

Thanks in advance

Copyright © 2005-08 www.BigResource.com, All rights reserved