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
' 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.WindowState = GetSetting(AppName, frm.Name, "WindowState", _
' Delete form settings
Sub DeleteFormSettings(ByVal AppName As String, frm As Object)
DeleteSetting AppName, frm.name
Using these routines is straightforward:
Private Sub Form_Load()
LoadFormSettings "MyApp", Me
Private Sub Form_Unload(Cancel As Integer)
SaveFormSettings "MyApp", Me
Hi. I have a form with list box : lst_product, datagridview : grd_order and button: btn_addline. lst_product has a list of product ids selected from database (MS Acess 2013) , grd_order is by default empty except for 2 headers and btn_addline adds rows to grd_order.
Hi, as I was told that my code doesn’t scale well at all, I thought perhaps I’d try to get a better understanding of interfaces/abstract classes and classes and the relationship between them.
I don’t want at this stage work on a big separate project as I've already got plenty ...
I am writing a java program that needs to execute shell commands, so I wrote a function that would take the command to execute as a string (ie: "mkdir ~/Folder1") and execute that command with the shell. Here is the function:
Runtime run = Runtime.getRuntime();
Process pr = ...