xtd 0.2.0
Loading...
Searching...
No Matches
hello_world_label.cpp

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

Windows

macOS

Gnome

#include <xtd/xtd>
using namespace 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(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.shadow(true);
label.text("Hello, World!");
}
private:
};
}
auto main()->int {
application::run(hello_world_label_example::main_form {});
}
Defines a particular format for text, including font face, size, and style attributes....
Definition font.h:45
virtual const xtd::ustring & text() const noexcept
Gets the text associated with this control.
virtual drawing::color fore_color() const noexcept
Gets the foreground color of the control.
virtual drawing::font font() const noexcept
Gets the font of the text displayed by the control.
virtual dock_style dock() const noexcept
Gets which control borders are docked to its parent control and determines how a control is resized w...
Represents a window or dialog box that makes up an application's user interface.
Definition form.h:52
Represents a standard Windows label.
Definition label.h:36
virtual bool shadow() const noexcept
Gets a value that allows to draw a drop shadow under the text.
virtual xtd::forms::content_alignment text_align() const noexcept
Gets the alignment of the text on the label control.
@ 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 actions_system_images.h:11
The xtd::forms namespace contains classes for creating Windows-based applications that take full adva...
Definition xtd_about_box.h:12
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.h:10