make these changes, then it should work.
string resultFilePath;
...
private void listBox1_SelectedIndexChanged(object sender, EventArgs e)
{
resultFilePath= rootFolder + @"\" + (sender as ListBox).SelectedItem.ToString();
}
private void button1_Click(object sender, EventArgs e)
{
Process.Start("notepad.exe", resultFilePath);
}
Also make sure the control events are working. I have seen where someone will cut and paste event code but the event is not connected to the control.
You may also want to filter the file type to those of intrest, for instance if you only want to see text files use the following..
FileInfo[] Files = dinfo.GetFiles("*.txt");