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

The following code example demonstrate the use of label control.

Windows

macOS

Gnome

#include <xtd/xtd>
using namespace xtd;
using namespace xtd::drawing;
using namespace xtd::forms;
namespace examples {
class main_form : public form {
public:
main_form() {
text("Hello world (label)");
controls().push_back(label);
label.dock(dock_style::fill);
label.font(drawing::font(label.font(), 32, font_style::bold|font_style::italic));
label.fore_color(color::green);
label.text("Hello, World!");
}
private:
forms::label label;
};
}
int main() {
application::run(examples::main_form());
}
static const xtd::drawing::color green
Gets a system-defined color that has an ARGB value of 0xFF008000. This field is constant.
Definition: color.h:201
Represents a standard Windows label.
Definition: label.h:26
@ middle_center
Content is vertically aligned at the middle, and horizontally aligned at the center.
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