Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Public Class Form1
- Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
- If My.Computer.Registry.GetValue("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run", "StartUpApp", Nothing) Is Nothing Then
- MessageBox.Show("registry belum ada bro")
- checkBoxStartUp.Checked = True
- Else
- checkBoxStartUp.Checked = False
- End If
- End Sub
- Private Sub buttonSaveClose_Click(sender As Object, e As EventArgs) Handles buttonSaveClose.Click
- If (checkBoxStartUp.Checked = True) Then
- My.Computer.Registry.SetValue("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run", "StartUpApp", "[path dari aplikasi]")
- Else
- Dim subKey = My.Computer.Registry.CurrentUser.OpenSubKey("Software\Microsoft\Windows\CurrentVersion\Run", True)
- subKey.DeleteValue("StartUpApp")
- End If
- Close()
- End Sub
- End Class
Advertisement
Add Comment
Please, Sign In to add comment