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
control.cpp

The following code example demonstrate the use of control control.

Windows

macOS

Gnome

#include <xtd/xtd>
using namespace xtd;
using namespace xtd::drawing;
using namespace xtd::forms;
namespace examples {
class form1 : public form {
public:
form1() {
text("Control example");
control1.parent(*this);
control1.cursor(cursors::hand());
control1.back_color(colors::spring_green());
control1.location({50, 50});
control1.size({100, 50});
control1.click += [&] {
control1.back_color(control1.back_color() == colors::spring_green() ? colors::orange_red() : colors::spring_green());
};
}
private:
control control1;
};
}
int main() {
application::run(examples::form1());
}
Defines the base class for controls, which are components with visual representation.
Definition: control.h:67
Represents a window or dialog box that makes up an application's user interface.
Definition: form.h:40
The xtd::drawing namespace provides access to GDI+ basic graphics functionality. More advanced functi...
Definition: bitmap.h:11
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