W
Wim
I'm trying to add files with a OpenFileDialog to a listview. This is what
I've come up with sofar:
protected void ButAddClick(object sender, System.EventArgs e)
{
OpenFileDialog MyDialog = new OpenFileDialog();
MyDialog.Multiselect = true ;
MyDialog.Filter = "WAVE files (*.wav)|*.wav|All files (*.*)|*.*" ;
MyDialog.RestoreDirectory = true ;
MyDialog.Title = "Add Files";
if (MyDialog.ShowDialog() == DialogResult.OK)
* foreach (int i in MyDialog.FileNames())
* listView.Items.Add(MyDialog.FileNames(i), i);
}
But the compiler says: "'System.Windows.Forms.FileDialog.FileNames'
denotes a 'property' where a 'method' was expected" about both lines with
a *.
Could someone explain to me what I'm doing wrong? TIA!
I've come up with sofar:
protected void ButAddClick(object sender, System.EventArgs e)
{
OpenFileDialog MyDialog = new OpenFileDialog();
MyDialog.Multiselect = true ;
MyDialog.Filter = "WAVE files (*.wav)|*.wav|All files (*.*)|*.*" ;
MyDialog.RestoreDirectory = true ;
MyDialog.Title = "Add Files";
if (MyDialog.ShowDialog() == DialogResult.OK)
* foreach (int i in MyDialog.FileNames())
* listView.Items.Add(MyDialog.FileNames(i), i);
}
But the compiler says: "'System.Windows.Forms.FileDialog.FileNames'
denotes a 'property' where a 'method' was expected" about both lines with
a *.
Could someone explain to me what I'm doing wrong? TIA!