Imports System.Windows.Forms

Public Class frmPDFScanList
    Public KdNr As Integer = -1
    'Dim DATENSERVER As New cDATENSERVER
    Public _DATENSERVER_ORDNER As String = ""
    Public _TEXT_PDF As String = ""
    ' Public ScanID As String = ""
    ' Public pdf_Path As String = ""

    Public Event FileAdded(ScanID As Integer, path As String, name As String)
    Sub New()
        ' Dieser Aufruf ist für den Designer erforderlich.
        InitializeComponent()
        ' Fügen Sie Initialisierungen nach dem InitializeComponent()-Aufruf hinzu.

    End Sub

    Sub New(KdNr, _DATENSERVER_ORDNER, _TEXT_PDF)

        ' Dieser Aufruf ist für den Designer erforderlich.
        InitializeComponent()
        Me.KdNr = KdNr
        ' Fügen Sie Initialisierungen nach dem InitializeComponent()-Aufruf hinzu.

    End Sub

    Private Sub FlatButton1_Click(sender As Object, e As EventArgs) Handles FlatButton1.Click
        Me.Close()
    End Sub

    Private Sub frmPDFScanList_Shown(sender As Object, e As EventArgs) Handles Me.Shown
        Me.Location = Windows.Forms.Cursor.Position
    End Sub

    Private Sub frmPDFScanList_LostFocus(sender As Object, e As EventArgs) Handles Me.Deactivate, Me.LostFocus
        ''Threading.Thread.Sleep(100)
        'For Each c In Me.FlowLayoutPanel.Controls
        '    If DirectCast(c, usrCntLPDFScanSimple).cntxt.Visible Then
        '        Exit Sub
        '    End If
        'Next
        'For Each c In Me.listlOld.Controls
        '    If DirectCast(c, usrCntLPDFScanSimple).cntxt.Visible Then
        '        Exit Sub
        '    End If
        'Next
        Dim trd = New System.Threading.Thread(AddressOf Me.threadClose)
        trd.IsBackground = True
        trd.Start()


    End Sub

    Sub threadClose()
        Threading.Thread.Sleep(100)
        If Form.ActiveForm Is Nothing Then Exit Sub
        If Me IsNot Form.ActiveForm Then Me.Close()
    End Sub


End Class