Hi, i'm having a little bit of trouble with making my application run at startup... I'm using this code:
So... What I'm doing is creating a registry value to make the program run at startup... Ok, so that works fine.... But, if i make some changes to a listbox that i have in there (saves the information in a text file), when it loads at startup, it doesnt load the newly-edited info, it loads the information when the registry value was first created, how can i prevent this from happening?Code:Private Sub CheckBox5_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBox5.CheckedChanged If CheckBox5.Checked = True Then CheckBox6.Checked = False CheckBox6.Enabled = False Dim key As Microsoft.Win32.RegistryKey key = Microsoft.Win32.Registry.CurrentUser.OpenSubKey("SOFTWARE\Microsoft\Windows\CurrentVersion\Run", True) key.SetValue("To-Do List", Application.ExecutablePath) My.Settings.DefaultCheck5 = True ElseIf CheckBox5.Checked = False Then CheckBox6.Enabled = True Microsoft.Win32.Registry.CurrentUser.OpenSubKey("SOFTWARE\Microsoft\Windows\CurrentVersion\Run", True).DeleteValue("To-Do List", False) My.Settings.DefaultCheck5 = False End If End Sub





Reply With Quote