You can use SaveSetting()
Jx_Man
Senior Poster
3,533 posts since Nov 2007
Reputation Points: 1,488
Solved Threads: 524
Skill Endorsements: 64
debasisdas
Posting Genius
6,968 posts since Feb 2007
Reputation Points: 722
Solved Threads: 457
Skill Endorsements: 20
Yes it is.
please try this sample.
SaveSetting Your_Application_name.EXE, "textboxes", "text1", text1.Text
or
SaveSetting(App.EXEName, "Textboxes\frmMain", "Text1", frmMain.Text1.Text)
debasisdas
Posting Genius
6,968 posts since Feb 2007
Reputation Points: 722
Solved Threads: 457
Skill Endorsements: 20
code in debasisdas link is for vb2005 but SaveSetting have same way to use in vb6.
there are sample code too in debasisdas link.
See if this help :
' Save form settings
Function SaveFormSettings(ByVal AppName As String, frm As Object)
SaveSetting AppName, frm.Name, "Left", frm.Left
SaveSetting AppName, frm.Name, "Top", frm.Top
SaveSetting AppName, frm.Name, "Width", frm.Width
SaveSetting AppName, frm.Name, "Height", frm.Height
SaveSetting AppName, frm.Name, "WindowState", frm.WindowState
End Function
' Restore form settings.
Function LoadFormSettings(ByVal AppName As String, frm As Object)
Dim currWindowState As Integer
' in case no value is in the registry
On Error Resume Next
' If the form is currently maximized or minimized, temporarily
' revert to normal state, otherwise the Move command fails.
currWindowState = frm.WindowState
If currWindowState <> 0 Then frm.WindowState = 0
' Use a Move method to avoid multiple Resize and Paint events.
frm.Move GetSetting(AppName, frm.Name, "Left", frm.Left), _
GetSetting(AppName, frm.Name, "Top", frm.Top), GetSetting(AppName, _
frm.Name, "Width", frm.Width), GetSetting(AppName, frm.Name, "Height", _
frm.Height)
frm.WindowState = GetSetting(AppName, frm.Name, "WindowState", _
currWindowState)
End Function
' Delete form settings
Sub DeleteFormSettings(ByVal AppName As String, frm As Object)
DeleteSetting AppName, frm.name
End Sub
Using these routines is straightforward:
Private Sub Form_Load()
LoadFormSettings "MyApp", Me
End Sub
Private Sub Form_Unload(Cancel As Integer)
SaveFormSettings "MyApp", Me
End Sub
Jx_Man
Senior Poster
3,533 posts since Nov 2007
Reputation Points: 1,488
Solved Threads: 524
Skill Endorsements: 64
Question Answered as of 2 Years Ago by
debasisdas
and
Jx_Man