• Log in or sign up for an account here: https://www.sythe.org/login

Need Save/Load Buttons

  • Thread starter Thread starter Teizhcial
  • Start date Start date
T

Teizhcial

Guest
i'm making a program. I added a menu with a button to save and open files. The thing is i dont know what the code is that i need to add to the save and open buttons. I know it uses a common dialog box, and that i need it to just save the program with all the changes made. I also know i need to add code (for the open button) that will let me open saved files.
 
as in saving text, images, settings or something else?

saving text to a file.
its something along these lines, this is off the top of my head and i doubt it will work:
Code:
Saving:
open [filepath & name] for input as #1
    write #1, "hi"
close #1

Loading:
dim shold as string
open [filepath & name] for output as #1
    shold = lof(input) ' <---  won't work i forget how lof() works
close #1

i might have the input / output commands around the wrong way to, iunno
 
Also he said,

i dont need text saved or anything like that. I need it to save changes made in the program. So lets say someone inserts a variable into one of the text boxes, i need to add a button that will save the program but with the changes added. I also need to add a button that will let me open the saved file once its saved that way i can edit the changes.
 
Again, don't be lazy. Look for Saving with .ini's. =( Laziness ftl.
 
Use my favorite functions. Savesetting and getsetting.
 
Savesetting
Code:
SaveSetting App.EXEName, "Options", "Name_Label", lblName.Caption

Getsetting
Code:
lblName.Caption = GetSetting(App.EXEName, "Options", "Name_Label", "")
 
yes but when i do that it says object missing. Also is there a way to make it save out of a common dialog box?
 
Replace lblName with your control name. Also replace caption to what ever applies to. Ex txtName.text, lblName.forcolor, txtName.Backcolor, etc.
 
thanks,
and covey:
calm the hell down. Its not like i'm new to vb6, i've been using it a while now and i did use thesearch button at first so stop getting angry. Besides its just a question, and i do show initiative to learn. Thats the reason i'm asking how. So that i can learn how to do it.
 
Runescape Gamblingrunescape gambling
Back
Top