#include <xtd/forms/application>
#include <xtd/forms/button>
#include <xtd/forms/form>
#include <xtd/forms/message_box>
#include <xtd/forms/open_file_box>
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] {
string file_name;
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 += [] {
message_box::show(string::format(
"Selected files are:\n{}", string::join(
"\n", file_names)));
};
}
private:
button button_open_single_file;
button button_open_multiple_files;
};
auto main() -> int {
}
Represents a strongly typed list of objects that can be accessed by index. Provides methods to search...
Definition list.hpp:80
size_t size
Represents a size of any object in bytes.
Definition size.hpp:23
The xtd::collections::generic namespace contains interfaces and classes that define generic collectio...
Definition comparer.hpp:16
Contains classes that represent ASCII and Unicode character encodings; abstract base classes for conv...
Definition basic_string_builder.hpp:16
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition abstract_object.hpp:8