Public Class AllFields
    Private Sub LB_SelectedIndexChanged(sender As Object, e As EventArgs) Handles LB.SelectedIndexChanged

    End Sub

    Private Sub LB_MouseDown(sender As Object, e As MouseEventArgs) Handles LB.MouseDown
        If e.Button = Windows.Forms.MouseButtons.Right Then
            Clipboard.SetText(LB.SelectedItem)
        ElseIf e.Button = Windows.Forms.MouseButtons.Middle Then
            Dim rds() As String = Split(LB.SelectedItem, " | ",)
            EF23.iMainCat.Text = ""
            EF23.iSubCat.Text = ""
            EF23.iCat.Text = ""

            For i As Integer = 0 To rds.Length - 1
                If i = 0 And rds(i) <> "" Then
                    EF23.iMainCat.Text = rds(i)
                    pLMC = MP & EF23.iMainCat.Text & "\"

                    EF23.iSubCat.Items.Clear()
                    EF23.iSubCat.Text = ""
                    EF23.iCat.Text = ""
                    EF23.iField1.Text = ""
                    EF23.iField2.Text = ""
                    EF23.iField3.Text = ""
                    EF23.iField4.Text = ""

                    FileOpen(1, pLMC & "SubCat", OpenMode.Append) : FileClose(1)
                    FileOpen(1, pLMC & "SubCat", OpenMode.Input)
                    Do While Not EOF(1)
                        EF23.iSubCat.Items.Add(LineInput(1)) ' & FF)
                    Loop
                    FileClose(1)
                ElseIf i = 1 And rds(i) <> "" Then
                    EF23.iSubCat.Text = rds(i)
                    pLC = pLMC & EF23.iSubCat.Text & "\"

                    EF23.iCat.Items.Clear()
                    EF23.iCat.Text = ""
                    'EF23.iField1.Text = ""
                    'EF23.iField2.Text = ""
                    'EF23.iField3.Text = ""
                    'EF23.iField4.Text = ""

                    FileOpen(1, pLC & "Cat", OpenMode.Append) : FileClose(1)
                    FileOpen(1, pLC & "Cat", OpenMode.Input)
                    Do While Not EOF(1)
                        EF23.iCat.Items.Add(LineInput(1)) ' & FF)
                    Loop
                    FileClose(1)
                ElseIf i = 2 And rds(i) <> "" Then
                    EF23.iCat.Text = rds(i)
                    pLF = pLC & EF23.iCat.Text & "\"

                    EF23.iField1.Text = ""
                    EF23.iField2.Text = ""
                    EF23.iField3.Text = ""
                    EF23.iField4.Text = ""
                    EF23.iField1.Items.Clear()
                    EF23.iField2.Items.Clear()
                    EF23.iField3.Items.Clear()
                    EF23.iField4.Items.Clear()

                    Dim AA As String = ""
                    FileOpen(1, pLF & "#Fields", OpenMode.Append) : FileClose(1)
                    FileOpen(1, pLF & "#Fields", OpenMode.Input)
                    Do While Not EOF(1)
                        AA = LineInput(1)
                        EF23.iField1.Items.Add(AA) ' & FF)
                        EF23.iField2.Items.Add(AA) ' & FF)
                        EF23.iField3.Items.Add(AA) ' & FF)
                        EF23.iField4.Items.Add(AA) ' & FF)
                    Loop
                    FileClose(1)

                    FileOpen(1, pLF & "#FieldsDEF", OpenMode.Append) : FileClose(1)
                    FileOpen(1, pLF & "#FieldsDEF", OpenMode.Input)
                    Do While Not EOF(1)
                        EF23.iField1.Text = LineInput(1)
                        EF23.iField2.Text = LineInput(1)
                        EF23.iField3.Text = LineInput(1)
                        EF23.iField4.Text = LineInput(1)
                    Loop
                    FileClose(1)
                End If
            Next
        End If
    End Sub

    Private Sub MT_SelectedIndexChanged(sender As Object, e As EventArgs) Handles MT.SelectedIndexChanged

    End Sub

    Private Sub MT_MouseLeave(sender As Object, e As EventArgs) Handles MT.MouseLeave
        MT.Height = 5
    End Sub

    Private Sub MT_MouseMove(sender As Object, e As MouseEventArgs) Handles MT.MouseMove
        MT.Height = 52
    End Sub
End Class