Filter not working correctly in OpenFileDialog
-
Hello, I am experiencing some weirdness with my OpenFileDialog filter. When I first open the dialog, the filter works and shows me the files with the filename scheme that I specify. However, if I select a different filter, then all the files disappear from the list. In addition, if I manually type the filter into the filename field and press Enter, then the files show up again. Here is a snippet where I create the dialog:
System::Void button_xmtr_Click(System::Object * sender, System::EventArgs * e) { OpenFileDialog* dlg = new OpenFileDialog(); dlg->Title = S"Choose Transmitter file"; dlg->InitialDirectory = S"input"; dlg->Filter = S"Transmitter files (xmtr*.dat)|xmtr*.dat|DAT files (*.dat)|*.dat|All files (*.*)|*.*"; if (dlg->ShowDialog() == DialogResult::OK) { textbox_xmtr->Text = dlg->FileName; } }
Has anybody else run into this problem? Does anybody know of a workaround? Thanks. -- Marcus Kwok
-
Hello, I am experiencing some weirdness with my OpenFileDialog filter. When I first open the dialog, the filter works and shows me the files with the filename scheme that I specify. However, if I select a different filter, then all the files disappear from the list. In addition, if I manually type the filter into the filename field and press Enter, then the files show up again. Here is a snippet where I create the dialog:
System::Void button_xmtr_Click(System::Object * sender, System::EventArgs * e) { OpenFileDialog* dlg = new OpenFileDialog(); dlg->Title = S"Choose Transmitter file"; dlg->InitialDirectory = S"input"; dlg->Filter = S"Transmitter files (xmtr*.dat)|xmtr*.dat|DAT files (*.dat)|*.dat|All files (*.*)|*.*"; if (dlg->ShowDialog() == DialogResult::OK) { textbox_xmtr->Text = dlg->FileName; } }
Has anybody else run into this problem? Does anybody know of a workaround? Thanks. -- Marcus Kwok
-
Hello, I am experiencing some weirdness with my OpenFileDialog filter. When I first open the dialog, the filter works and shows me the files with the filename scheme that I specify. However, if I select a different filter, then all the files disappear from the list. In addition, if I manually type the filter into the filename field and press Enter, then the files show up again. Here is a snippet where I create the dialog:
System::Void button_xmtr_Click(System::Object * sender, System::EventArgs * e) { OpenFileDialog* dlg = new OpenFileDialog(); dlg->Title = S"Choose Transmitter file"; dlg->InitialDirectory = S"input"; dlg->Filter = S"Transmitter files (xmtr*.dat)|xmtr*.dat|DAT files (*.dat)|*.dat|All files (*.*)|*.*"; if (dlg->ShowDialog() == DialogResult::OK) { textbox_xmtr->Text = dlg->FileName; } }
Has anybody else run into this problem? Does anybody know of a workaround? Thanks. -- Marcus Kwok