Adblock breaks this site

Need Save/Load Buttons

Discussion in 'Archives' started by Teizhcial, May 14, 2007.

  1. Teizhcial

    Teizhcial Guest

    Referrals:
    0
    Need Save/Load Buttons

    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.
     
  2. Covey

    Covey Creator of EliteSwitch
    Retired Sectional Moderator Visual Basic Programmers

    Joined:
    Sep 9, 2005
    Posts:
    4,510
    Referrals:
    9
    Sythe Gold:
    9
    Discord Unique ID:
    807246764155338833
    Discord Username:
    Covey#1816
    Need Save/Load Buttons

    don't be lazy and use the search buttons.
     
  3. Cody

    Cody Grand Master
    Visual Basic Programmers

    Joined:
    May 10, 2005
    Posts:
    3,052
    Referrals:
    5
    Sythe Gold:
    30
    Need Save/Load Buttons

    SaveSetting

    Look it up :)
     
  4. Darthatron

    Darthatron Massive Troll
    Retired Sectional Moderator Visual Basic Programmers

    Joined:
    May 22, 2006
    Posts:
    1,612
    Referrals:
    3
    Sythe Gold:
    0
    Need Save/Load Buttons

    as in saving text, images, settings or something else?
     
  5. Covey

    Covey Creator of EliteSwitch
    Retired Sectional Moderator Visual Basic Programmers

    Joined:
    Sep 9, 2005
    Posts:
    4,510
    Referrals:
    9
    Sythe Gold:
    9
    Discord Unique ID:
    807246764155338833
    Discord Username:
    Covey#1816
    Need Save/Load Buttons

    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
     
  6. Teizhcial

    Teizhcial Guest

    Referrals:
    0
    Need Save/Load Buttons

    Sorry I just need them because a friend of mine needs them.
     
  7. Teizhcial

    Teizhcial Guest

    Referrals:
    0
    Need Save/Load Buttons

    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.
     
  8. timk777

    timk777 Active Member

    Joined:
    Feb 19, 2007
    Posts:
    156
    Referrals:
    0
    Sythe Gold:
    0
    Need Save/Load Buttons

    Again, don't be lazy. Look for Saving with .ini's. =( Laziness ftl.
     
  9. jdsfighter

    jdsfighter Forum Addict
    Visual Basic Programmers

    Joined:
    Jan 21, 2007
    Posts:
    603
    Referrals:
    0
    Sythe Gold:
    0
    Need Save/Load Buttons

    Use my favorite functions. Savesetting and getsetting.
     
  10. meeman666

    meeman666 Guest

    Referrals:
    0
    Need Save/Load Buttons

    What would the code for a savesetting be like?:confused:
     
  11. jdsfighter

    jdsfighter Forum Addict
    Visual Basic Programmers

    Joined:
    Jan 21, 2007
    Posts:
    603
    Referrals:
    0
    Sythe Gold:
    0
    Need Save/Load Buttons

    Savesetting
    Code:
    SaveSetting App.EXEName, "Options", "Name_Label", lblName.Caption
    Getsetting
    Code:
    lblName.Caption = GetSetting(App.EXEName, "Options", "Name_Label", "")
     
  12. Purelustre

    Purelustre Member
    Banned

    Joined:
    May 17, 2007
    Posts:
    59
    Referrals:
    0
    Sythe Gold:
    0
    Need Save/Load Buttons

    ugh I'm having problems
     
  13. meeman666

    meeman666 Guest

    Referrals:
    0
    Need Save/Load Buttons

    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?
     
  14. Covey

    Covey Creator of EliteSwitch
    Retired Sectional Moderator Visual Basic Programmers

    Joined:
    Sep 9, 2005
    Posts:
    4,510
    Referrals:
    9
    Sythe Gold:
    9
    Discord Unique ID:
    807246764155338833
    Discord Username:
    Covey#1816
    Need Save/Load Buttons

    noone is going to help you unless you show initiative to help yourself.
    now either just the fuck up and die, or click on the fucking search button.
     
  15. jdsfighter

    jdsfighter Forum Addict
    Visual Basic Programmers

    Joined:
    Jan 21, 2007
    Posts:
    603
    Referrals:
    0
    Sythe Gold:
    0
    Need Save/Load Buttons

    Replace lblName with your control name. Also replace caption to what ever applies to. Ex txtName.text, lblName.forcolor, txtName.Backcolor, etc.
     
  16. meeman666

    meeman666 Guest

    Referrals:
    0
    Need Save/Load Buttons

    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.
     
< chad1's free MMing! | Need FireCaper and ToRsO >


 
 
Adblock breaks this site