0
I am implementing the Drag files function to fill a Listbox with the file path.
It works very well, but I would like to put a "filter" making it possible only to import txt.
if it is not txt should appear an error Messagebox to the user.
Follows the Code
private void listBoxArquivosSelecionados_DragOver(object sender, DragEventArgs e)
    {
        if (e.Data.GetDataPresent(DataFormats.FileDrop))
            e.Effect = DragDropEffects.Link;
        else
            e.Effect = DragDropEffects.None;
    }
    private void listBoxArquivosSelecionados_DragDrop(object sender, DragEventArgs e)
    {
        string[] arquivos = e.Data.GetData(DataFormats.FileDrop) as string[];
        if (arquivos != null)
            listBoxArquivosSelecionados.Items.AddRange(arquivos);
        CarregarStatus();
    }