xtd - Reference Guide  0.2.0
Modern c++17/20 framework to create console, GUI and unit test applications on Windows, macOS, Linux, iOS and android.
input_dialog_password.cpp

The following code example demonstrate the use of input_dialog dialog with password.

Windows
input_dialog_password_w.png

input_dialog_password_wd.png
macOS
input_dialog_passwordpassword_m.png

input_dialog_password_md.png
Gnome
input_dialog_password_g.png

input_dialog_multiline_gd.png
#include <xtd/xtd>
using namespace xtd;
using namespace xtd::forms;
namespace examples {
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.use_system_password_char(true);
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:
label label1;
};
}
int main() {
application::run(examples::form1());
}