using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace FileListBox_Demo
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void fileListBox1_Click(object sender, EventArgs e)
        {
            label1.Text = "Zaznaczony plik: " + fileListBox1.FileName;
        }

        private void fileListBox1_DirectoryPathChanged(object sender, EventArgs e)
        {
            label2.Text = "Zmiana katalogu na: " + fileListBox1.DirectoryPath;
        }

        private void fileListBox1_FileDoubleClicked(object sender, EventArgs e, string fileName)
        {
            System.Diagnostics.Process.Start(fileName);
        }

        private void checkBox1_CheckedChanged(object sender, EventArgs e)
        {
            fileListBox1.DirectoriesVisible = checkBox1.Checked;
        }
    }
}