xtd 0.2.0
Loading...
Searching...
No Matches
input_dialog_password.cpp

demonstrates the use of xtd::forms::input_dialog dialog.

Windows

macOS

Gnome

#include <xtd/forms/application>
#include <xtd/forms/button>
#include <xtd/forms/form>
#include <xtd/forms/input_dialog>
#include <xtd/forms/label>
using namespace xtd;
using namespace xtd::forms;
namespace input_dialog_password_example {
class form1 : public form {
public:
form1() {
text("Input dialog password example");
controls().push_back_range({button1, label1});
button1.location({10, 10});
button1.auto_size(true);
button1.text("Password...");
button1.click += [&] {
input_dialog.text("User password");
input_dialog.message("user: admin");
input_dialog.value(label1.text());
if (input_dialog.show_sheet_dialog(*this) == dialog_result::ok)
label1.text(input_dialog.value());
};
label1.location({10, 50});
label1.auto_size(true);
label1.text("sysad47@74dasys");
}
private:
button button1;
label label1;
};
}
auto main()->int {
application::run(input_dialog_password_example::form1 {});
}
Represents a Windows button control.
Definition button.h:47
xtd::forms::dialog_result show_sheet_dialog(const iwin32_window &owner)
Runs a common dialog box with the specified owner.
Represents a window or dialog box that makes up an application's user interface.
Definition form.h:52
Represents a common dialog box that displays input dialog.
Definition input_dialog.h:36
xtd::ustring message() const noexcept
Gets the text message.
bool use_system_password_char() const noexcept
Gets use system password char status.
xtd::ustring text() const noexcept
Gets the dialog caption text.
xtd::ustring value() const noexcept
Gets the value.
Represents a standard Windows label.
Definition label.h:36
The xtd::forms namespace contains classes for creating Windows-based applications that take full adva...
Definition xtd_about_box.h:12
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.h:10