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
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:
};
}
int main() {
application::run(examples::main_form());
}
Defines a particular format for text, including font face, size, and style attributes....
Definition: font.h:39
virtual drawing::font font() const
Gets the font of the text displayed by the control.
virtual const xtd::ustring & text() const
Gets the text associated with this control.
Definition: control.h:650
virtual drawing::color fore_color() const
Gets the foreground color of the control.
virtual dock_style dock() const
Gets or sets which control borders are docked to its parent control and determines how a control is r...
Definition: control.h:423
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
virtual xtd::forms::content_alignment text_align() const
Gets the alignment of the text on the button control.
Definition: label.h:56
@ 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