Imports System.Windows.Forms

Public Class frmZEButtons

    Dim art As String
    Public resultCode As Integer = -1

    Sub New(art As String)
        Me.art = art
        InitializeComponent()
    End Sub


    Private Sub btnZEKommen_Click(sender As Object, e As EventArgs) Handles btnIMEXKommen.Click, btnIMEXGehen.Click, btnATTGehen.Click, btnATTKommen.Click, btnVergGehen.Click, btnVergKommen.Click, btnFOGehen.Click, btnFOKommen.Click
        Select Case sender.name
            Case "btnIMEXKommen" : resultCode = 19
            Case "btnIMEXGehen" : resultCode = 19
            Case "btnATTKommen" : resultCode = 18
            Case "btnATTGehen" : resultCode = 18
            Case "btnVergKommen" : resultCode = 0
            Case "btnVergGehen" : resultCode = 0
            Case "btnFOKommen" : resultCode = 20
            Case "btnFOGehen" : resultCode = 20
        End Select
    End Sub

    Private Sub frmZEButtons_Load(sender As Object, e As EventArgs) Handles MyBase.Load

        Select Case art
            Case "in"
                btnIMEXKommen.Enabled = True
                btnATTKommen.Enabled = True
                btnFOKommen.Enabled = True
                btnVergKommen.Enabled = True
            Case "out"
                btnIMEXGehen.Enabled = True
                btnATTGehen.Enabled = True
                btnFOGehen.Enabled = True
                btnVergGehen.Enabled = True
            Case Else

        End Select

        Me.TopMost = True

    End Sub


    Private Sub frmZEButtons_KeyDown(sender As Object, e As KeyEventArgs) Handles MyBase.KeyDown
        If e.KeyCode = Keys.Escape Then Me.Close()
    End Sub
End Class