I added these three components from tools menu/choose toolbox items; however they are not working when I changed the drive or directory..
here is the code of these three components in case they change
private void driveListBox1_SelectedIndexChanged(object sender, EventArgs e)
{
try
{
dirListBox1.Path = driveListBox1.Drive;
}
catch (Exception ex)
{
MessageBox.Show("Error : " + ex.Message,
"Error",
MessageBoxButtons.OK,
MessageBoxIcon.Error);
}
}
private void dirListBox1_SelectedIndexChanged(object sender, EventArgs e)
{
try
{
this.fileListBox1.Path = this.dirListBox1.Path;
}
catch (Exception ex)
{
MessageBox.Show("Error : " + ex.Message,
"Error",
MessageBoxButtons.OK,
MessageBoxIcon.Error);
}
}
private void fileListBox1_SelectedIndexChanged(object sender, EventArgs e)
{
string fullPath = fileListBox1.Path + "\\" + fileListBox1.FileName;
try
{
StreamReader sr = new StreamReader(fullPath);
textBox2.Text = sr.ReadToEnd();
textBox1.Text = fullPath;
}
catch (Exception ex)
{
MessageBox.Show("Error : " + ex.Message,
"Error",
MessageBoxButtons.OK,
MessageBoxIcon.Error);
}
}
it is said that these components are compatible wth VB.NET, does it mean I can't use them in a C# project?