xtd 0.2.0
hello_world_label.cpp

The classic first application "Hello, World!" with xtd::forms::label control.

Windows

macOS

Gnome

#include <xtd/xtd>
using namespace xtd::drawing;
using namespace xtd::forms;
namespace hello_world_label_example {
class main_form : public form {
public:
main_form() {
text("Hello world (label)");
controls().push_back(label1);
label1.dock(dock_style::fill);
label1.font({label1.font(), 32, font_style::bold | font_style::italic});
label1.fore_color(color::green);
label1.shadow(true);
label1.text("Hello, World!");
}
private:
label label1;
};
}
auto main() -> int {
application::run(hello_world_label_example::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.hpp:212
static void run()
Begins running a standard application message loop on the current thread, without a form.
Represents a window or dialog box that makes up an application's user interface.
Definition form.hpp:54
Represents a standard Windows label.
Definition label.hpp:38
@ italic
Italic text.
Definition font_style.hpp:23
@ bold
Bold text.
Definition font_style.hpp:21
@ fill
All the control's edges are docked to the all edges of its containing control and sized appropriately...
Definition dock_style.hpp:35
@ middle_center
Content is vertically aligned at the middle, and horizontally aligned at the center.
Definition content_alignment.hpp:31
The xtd::drawing::text namespace provides advanced GDI+ typography functionality.
Definition font_collection.hpp:14
The xtd::drawing namespace provides access to GDI+ basic graphics functionality. More advanced functi...
Definition actions_system_images.hpp:10
The xtd::forms namespace contains classes for creating Windows-based applications that take full adva...
Definition texts.hpp:217