This is incredibly strange. I moved the
CheckState
sub from the module to the Main form class and it worked. My code now looks like this:
Public Class Form1
Public Problem As ProblemType
Dim Subscription As String = ""
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Me.BackgroundImage = My.Resources.wall
End Sub
Private Sub Form1_Shown(sender As Object, e As EventArgs) Handles Me.Shown
Dim T As New Threading.Thread(AddressOf DecryptSub)
T.IsBackground = False
T.Start()
Dim TR As New Threading.Thread(AddressOf CheckState)
TR.IsBackground = False
TR.Start()
If My.Settings.Enabled Then
Me.Invoke(Sub() Me.Label1.Text = "Enabled")
Else
Me.Invoke(Sub() Me.Label1.Text = "Disabled")
End If
End Sub
End Class
I really can't understand why but the important thing is that it worked!
Thanks to everyone!