xtd - Reference Guide  0.1.0
Modern c++17/20 framework to create console, GUI and unit test applications on Windows, macOS, Linux, iOS and android.
Loading...
Searching...
No Matches
command_link_button.cpp

The following code example demonstrate the use of command link button control.

Windows

macOS

Gnome

#include <xtd/xtd>
using namespace xtd;
using namespace xtd::forms;
namespace examples {
class form1 : public form {
public:
form1() {
text("Command link button example");
client_size({300, 300});
command_link_button1.parent(*this);
command_link_button1.texts("Command link", "width supplementary text");
// same as
//command_link_button1.text("Command link\nwidth supplementary text");
command_link_button1.location({30, 30});
command_link_button1.size({240, 60});
command_link_button1.click += [&] {
label1.text(ustring::format("command link button 1 clicked {} times", ++command_link_button1_clicked));
};
label1.parent(*this);
label1.auto_size(true);
label1.text("command link button 1 clicked 0 times");
label1.location({30, 100});
}
private:
command_link_button command_link_button1;
label label1;
int command_link_button1_clicked = 0;
};
}
int main() {
application::enable_button_images();
application::run(examples::form1());
}
Represents a window or dialog box that makes up an application's user interface.
Definition: form.h:40
Represents a standard Windows label.
Definition: label.h:26
The xtd::forms namespace contains classes for creating Windows-based applications that take full adva...
Definition: about_box.h:13
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition: system_report.h:17