#include <xtd/forms/application>
#include <xtd/forms/button>
#include <xtd/forms/form>
#include <xtd/forms/label>
#include <xtd/forms/open_file_dialog>
class form1 :
public form {
public:
form1() {
text(
"Open file dialog example");
auto_scroll(true);
dialog.filter("Text Files (*.txt)|*.txt|All Files (*.*)|*.*");
file_name = dialog.file_name();
label1.text(string::format("File = {}", file_name));
}
};
label1.parent(*this);
label1.text("File = ");
label1.auto_size(true);
label1.location({10, 50});
}
private:
string file_name;
};
auto main() -> int {
}
@ desktop
The logical Desktop rather than the physical file system location.
Definition environment.hpp:149
static xtd::string get_folder_path(environment::special_folder folder)
Gets the path to the system special folder that is identified by the specified enumeration.
Definition environment.hpp:613
static xtd::string get_directory_name(const xtd::string &path)
Returns the directory information for the specified path string.
static xtd::string get_file_name(const xtd::string &path)
Returns the file name and extension of the specified path string.
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