Public Class MainForm
    Dim att = 50
    Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Integer)

    Private Sub RegisterVehicleToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RegisterVehicleToolStripMenuItem.Click
        RegisterationForm.Show()
    End Sub

    Private Sub VehicleParkingToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles VehicleParkingToolStripMenuItem.Click
        ' Me.Hide()
        ParkingForm.Show()
    End Sub

    Private Sub ReportsToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ReportsToolStripMenuItem.Click
        Form3.Show()
    End Sub

   
    Private Sub ExitToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ExitToolStripMenuItem.Click
        Me.Close()

    End Sub

    Private Sub MainForm_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Out(888, 0)
        Timer1.Enabled = True
        ' fill()




    End Sub

    Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
        att = att + 50
        If att = 100 Then
            att = 50
            detct()

        End If
        ' MsgBox(Inp(889))
    End Sub
    Sub detct()
        'MsgBox(Inp(889))
        If Inp(889) = 56 Then
            '  If gtry = 0 Then
            If Val(gtry) = 0 Then
                gtry = 1

                Timer1.Enabled = False
                'End If
                fun1()
            End If

           

        End If
        'ProgressBar1.Value = 100
        'ProgressBar1.Maximum = 1000
        att = 50
        'If Timer1.Enabled = True Then
        '    Timer1.Enabled = False
        'End If


    End Sub
    Sub fun1()
        Out(888, 8)
        Sleep(2000)
        Out(888, 16)
        Sleep(2000)
        Out(888, 0)
        Timer1.Enabled = True
        Exit Sub
    End Sub

    'Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
    '    If Inp(889) <> 120 Then


    '        fill()

    '    End If
    'End Sub
    'Sub fill()
    '    'Timer1.Stop()
    '    Out(888, 8)
    '    'Sleep(2000)
    '    Timer2.Enabled = True

    '    'Sleep(2000)
    '    Out(888, 0)
    '    ' Timer1.Start()

    '    'Exit Sub
    '    gty()
    'End Sub
    'Sub gty()
    '    Timer1.Enabled = True
    'End Sub
    'Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
    '    detct()

    '    ' MsgBox(Inp(889))
    'End Sub
    'Sub detct()
    '    'MsgBox(Inp(889))
    '    If Inp(889) <> 120 Then
    '        Timer1.Enabled = False
    '        fill()
    '        Exit Sub
    '    End If
    '    'ProgressBar1.Value = 100
    '    'ProgressBar1.Maximum = 1000
    '    'att = 50
    '    'If Timer1.Enabled = True Then
    '    '    Timer1.Enabled = False
    '    'End If


    'End Sub

    'Private Sub Timer2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer2.Tick
    '    Out(888, 16)
    '    Timer2.Enabled = False
    'End Sub
End Class