Hi @OSVBNET ,
Try adding events dynamically.
Private Sub MyForm_Load(sender As Object, e As EventArgs) Handles MyBase.Load
SwitchButton1.Value = boolVal
AddHandler SwitchButton1.ValueChanged, AddressOf SwitchButton1_ValueChanged
End Sub
Private Sub SwitchButton1_ValueChanged(sender As System.Object, e As System.EventArgs)
Registry.CurrentUser.CreateSubKey(My app settings address).SetValue(ValueName, ValueData, ValueKind)
End Sub
Best Regards.
Jiachen Li
----------
If the answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.