Results 1 to 40 of 40

Thread: [RESOLVED] please some help with saving and loading changes

Threaded View

  1. #18
    PowerPoster
    Join Date
    Nov 2002
    Location
    Manila
    Posts
    7,629

    Re: please some help with saving and loading changes

    You can use the registry instead since its just one property
    Code:
    Option Explicit
    
    'sample has common dialog control and command button on form
    
    Private Sub Command1_Click()  'change form backcolor
       CommonDialog1.ShowColor
       Me.BackColor = CommonDialog1.Color
    End Sub
    
    Private Sub Form_Load()  'retrieve setting, use default value if reg key doesn't exist
       Me.BackColor = CLng(GetSetting("AppName", "Section", "BackColor", &H8000000F))
    End Sub
    
    
    Private Sub Form_Unload(Cancel As Integer)  'save setting for subsequent GetSetting()
       SaveSetting "AppName", "Section", "BackColor", Me.BackColor
    End Sub
    Of course you'll have to use more meaningful labels and values than the ones in the sample above.
    Last edited by leinad31; Feb 27th, 2007 at 03:20 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width