First, I have looked at this post. One of the answers seems to offer hope for filtering in ShowDialog by name. Now, here is a description of what I am trying to do:
I have this bit of C# code:
private System.Windows.Forms.OpenFileDialog csv_file_open_dlg;
.
.
.
csv_file_open_dlg.FileName = "";
csv_file_open_dlg.Filter = "csv files (*.csv)|*.csv|All files (*.*)|*.*";
int rc = 0;
if (csv_file_open_dlg.ShowDialog() == DialogResult.OK)
{
if (0 == m_csv_file_cmp_counter)
{
m_firstCsvFileSelected = csv_file_open_dlg.FileName;
}
.
.
.
If I select the first file -- May 18 Muni RosterDetailReport.csv -- and preserve its name in a string variable, is there a way to filter that file out the next time ShowDialog is run in the same directory?
In other words, after selecting May 18 Muni RosterDetailReport.csv, is there a way to feed that name back into ShowDialog
, as a filter?
I think the answer is no, but I am just double-checking. If not, is there a workaround by subscribing to the OpenFileDialog event as indicated in the post I noted at the beginning of this post?
Edit:
So it sounds like, I could use the OK event to prevent the user from selecting the first file a second time? I am hoping someone will answer this with an answer.