kk i have the following code to have a checkbox to have the program automatically open at startup or not:
VB Code:
Dim key As Microsoft.Win32.RegistryKey key = Microsoft.Win32.Registry.CurrentUser.OpenSubKey("SOFTWARE\Microsoft\Windows\CurrentVersion\Run", True) If CheckBox3.Checked = True Then key.SetValue("Notes", Application.ExecutablePath) MsgBox("Set '" & CType(key.GetValue("Notes"), String) & "' to open at system startup.") Else key.DeleteValue("Notes") End If
well it works perfectly fine but i noticed a little problem... when re-loading the application, i noticed that the checkbox is set back to the default setting (unchecked)
i want the app to check, as soon as the form is loaded, to see if the app is already in the registry to run at startup, and if so then have the checkbox checked, but if not then have it unchecked
all help would be appreciated
thanks
cheers,
Phil.





Reply With Quote