how??


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 14 of 14

Thread: how??

  1. #1
    Join Date
    Dec 2007
    Posts
    49

    how??

    welcome
    This code is the conservation of all the changes that occur on the project
    For example preserves within the written text) (_ even after closure
    I want to conservation this code save the visible of text1
    like this text1.visible=false

    if i open the project after i closed it. It must dontshow text1


    Code:
    Private Sub Form_Load()
    Text1.Text = GetSetting(App.Title, "Settings", "SaveInText1")
    End Sub
    Private Sub Form_Unload(Cancel As Integer)
    SaveSetting App.Title, "Settings", "SaveInText1", Trim(Text1.Text)
    End Sub
    how???

    iyado

  2. #2
    Join Date
    Apr 2007
    Location
    Sterling Heights, Michigan
    Posts
    8,666
    You can save booleans, but only as strings which would have to be processed within an IF/THEN/ELSE statement when your program opened.
    I don't answer coding questions via PM or Email. Please post a thread in the appropriate forum section.
    Please use [Code]your code goes in here[/Code] tags when posting code.
    Before posting your question, did you look here?
    Got a question on Linux? Visit our Linux sister site.
    Modifications Required For VB6 Apps To Work On Vista

  3. #3
    Join Date
    Dec 2007
    Posts
    49
    plees give me code

  4. #4
    Join Date
    Apr 2007
    Location
    Sterling Heights, Michigan
    Posts
    8,666
    Well, based on your first post, you know how to use GetSetting to retrieve the value of something that you have set.

    So, based on whether the textbox is visible or not, save the appropriate string and evaluate it when you use GetSetting to bring it back.
    I don't answer coding questions via PM or Email. Please post a thread in the appropriate forum section.
    Please use [Code]your code goes in here[/Code] tags when posting code.
    Before posting your question, did you look here?
    Got a question on Linux? Visit our Linux sister site.
    Modifications Required For VB6 Apps To Work On Vista

  5. #5
    Join Date
    Dec 2007
    Posts
    49
    im didnt standard any things

  6. #6
    Join Date
    Apr 2007
    Location
    Sterling Heights, Michigan
    Posts
    8,666
    Quote Originally Posted by kiss
    im didnt standard any things
    I don't know what you mean by this.
    I don't answer coding questions via PM or Email. Please post a thread in the appropriate forum section.
    Please use [Code]your code goes in here[/Code] tags when posting code.
    Before posting your question, did you look here?
    Got a question on Linux? Visit our Linux sister site.
    Modifications Required For VB6 Apps To Work On Vista

  7. #7
    Join Date
    Nov 2003
    Location
    Portland, OR
    Posts
    8,387
    Code:
    Private Sub Form_Load()
        Text1.Visible = CBool(GetSetting(App.Title, "Settings", "Text1Visible"))
    End Sub
    
    Private Sub Form_Unload(Cancel As Integer)
        SaveSetting App.Title, "Settings", "Text1Visible", Text1.Visible
    End Sub
    Phil Weber
    http://www.philweber.com

    Please post questions to the forums, where others may benefit.
    I do not offer free assistance by e-mail. Thank you!

  8. #8
    Join Date
    Dec 2007
    Posts
    49
    Quote Originally Posted by Phil Weber
    Code:
    Private Sub Form_Load()
        Text1.Visible = CBool(GetSetting(App.Title, "Settings", "Text1Visible"))
    End Sub
    
    Private Sub Form_Unload(Cancel As Integer)
        SaveSetting App.Title, "Settings", "Text1Visible", Text1.Visible
    End Sub
    thank you very much
    but the code formload error why??
    plese give me the corect code

    iyado

  9. #9
    Join Date
    Nov 2003
    Location
    Portland, OR
    Posts
    8,387
    The code is correct. It probably throws an error because the setting has not yet been written to the registry. Try adding "On Error Resume Next" as the first line of the Form_Load event.
    Phil Weber
    http://www.philweber.com

    Please post questions to the forums, where others may benefit.
    I do not offer free assistance by e-mail. Thank you!

  10. #10
    Join Date
    Dec 2007
    Posts
    49
    thanks you
    its corect
    , but if i use tis code after your code it copy the project but it didnt save new settings ? why>????

    Code:
    FileCopy App.Path & "\" & App.EXEName & ".exe", "C:\my project.exe"
    thank you
    iyado

  11. #11
    Join Date
    Apr 2007
    Location
    Sterling Heights, Michigan
    Posts
    8,666
    FileCopy is going to save any settings. It is just going to copy a file.

    SaveSettings would be needed to actual do the registry save.
    I don't answer coding questions via PM or Email. Please post a thread in the appropriate forum section.
    Please use [Code]your code goes in here[/Code] tags when posting code.
    Before posting your question, did you look here?
    Got a question on Linux? Visit our Linux sister site.
    Modifications Required For VB6 Apps To Work On Vista

  12. #12
    Join Date
    Dec 2007
    Posts
    49
    Quote Originally Posted by Hack
    FileCopy is going to save any settings. It is just going to copy a file.

    SaveSettings would be needed to actual do the registry save.
    how??
    Last edited by Hack; 02-21-2008 at 09:57 AM.

  13. #13
    Join Date
    Apr 2007
    Location
    Sterling Heights, Michigan
    Posts
    8,666
    This is from your first post
    Quote Originally Posted by kiss
    Code:
    Private Sub Form_Load()
    Text1.Text = GetSetting(App.Title, "Settings", "SaveInText1")
    End Sub
    Private Sub Form_Unload(Cancel As Integer)
    SaveSetting App.Title, "Settings", "SaveInText1", Trim(Text1.Text)
    End Sub
    so, I know you know how to use SaveSetting.

    That is how.
    I don't answer coding questions via PM or Email. Please post a thread in the appropriate forum section.
    Please use [Code]your code goes in here[/Code] tags when posting code.
    Before posting your question, did you look here?
    Got a question on Linux? Visit our Linux sister site.
    Modifications Required For VB6 Apps To Work On Vista

  14. #14
    Join Date
    Dec 2007
    Posts
    49
    ok thanks you

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center