demonstrates the use of xtd::forms::open_file_box file dialog.
- Windows
-
- macOS
-
- Gnome
-
#include <xtd/xtd>
using namespace std;
class form1 :
public form {
public:
form1() {
text(
"Open file box example");
client_size({400, 200});
controls().push_back_range({button_open_single_file, button_open_multiple_files});
button_open_single_file.parent(*this)
.location({10, 10})
.
text(
"Select single file")
.click += [this] {
auto res =
open_file_box::show(file_name, *
this,
"Please select a file...",
".",
"Text Files (*.txt)|*.txt|All Files (*.*)|*.*");
};
button_open_multiple_files.parent(*this)
.location({10, 45})
.
text(
"Select multiple files")
.click += [] {
vector<ustring> file_names;
};
}
private:
button button_open_single_file;
button button_open_multiple_files;
};
auto main()->int {
}