Imports System.Windows.Forms

Public Class frmError
    Public ValidatorError As String = ""
    Private Sub OK_Button_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OK_Button.Click
        Me.Close()
    End Sub

    Private Sub frmError_Load(sender As Object, e As System.EventArgs) Handles Me.Load
        If ValidatorError <> String.Empty Or errormessage <> String.Empty Then
            If ValidatorError <> String.Empty Then
                Me.txterror.Text = ValidatorError
            Else
                Me.txterror.Text = errormessage
            End If
            Me.Label1.Focus()
            Me.Timer1.Start()
        Else
            Me.Close()
        End If

    End Sub

    Private Sub Timer1_Tick(sender As System.Object, e As System.EventArgs) Handles Timer1.Tick
        If Me.OK_Button.Focused Then
            Me.Label1.Focus()
        End If
    End Sub

    Private Sub frmError_Shown(sender As Object, e As System.EventArgs) Handles Me.Shown
        Me.Label1.Focus()
    End Sub
End Class
