When I click my Exit Program button, it says
And sometimes I don't quite remember but it says something along the line ofCode:Object reference not set to an instance of an object.
RoundRobinPro is Disposed... (My Main app)
This is my login form, which I have made, the code I use is below
Anyone know what's wrong?Code:Option Strict On Option Explicit On Public Class LoginForm1 Private Sub OK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles LoginButton.Click Dim quit As Boolean = True If SignupRadio.Checked Then If System.IO.Directory.Exists("C:\Program Files\Round Robin Pro\Variables\" & _ UsernameTextBox.Text) Then quit = False Else System.IO.Directory.CreateDirectory("C:\Program Files\Round Robin Pro\Variables\" & _ UsernameTextBox.Text) RoundRobinPro.Dir.UsernameDir = RoundRobinPro.fnc _ .CapitalizeString(UsernameTextBox.Text) MsgBox("Your account has been created", MsgBoxStyle.OkOnly) End If End If Dim errorString As String = "" If LoginRadio.Checked Then If Not UsernameTextBox.Text.Length > 4 Then quit = False errorString &= "Your username must be atleast 5 characters long." & ControlChars.NewLine End If If Not PasswordTextBox.Text.Length > 4 Then quit = False errorString &= "Your password must be atleast 5 characters long." & ControlChars.NewLine End If If Not ConfirmPw_t.Text.Length > 4 Then quit = False errorString &= "Your confirm password must be atleast 5 characters long." & _ ControlChars.NewLine End If End If If quit Then Me.Close() Else MsgBox(errorString) End If End Sub Private Sub Cancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Me.Close() End Sub Private Sub Timer123_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer123.Tick If SignupRadio.Checked Then ConfirmPw_t.Visible = True ConfirmPw_l.Visible = True LoginButton.Text = "Signup" Else ConfirmPw_t.Visible = False ConfirmPw_l.Visible = False LoginButton.Text = "Login" End If End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Application.Exit() End Sub End Class




Reply With Quote