The following code example demonstrate the use of lcd_label control.
#include <xtd/xtd>
using namespace std::literals;
int main() {
auto counter = 0;
timer timer;
timer.interval(100ms);
form form_main;
form_main.text("Lcd label example 2");
form_main.start_position(form_start_position::center_screen);
form_main.auto_size_mode(forms::auto_size_mode::grow_and_shrink);
form_main.client_size({1456, 503});
lcd_label label;
label.parent(form_main);
label.dock(dock_style::fill);
label.fore_color(color::blue);
label.back_color(color::average(color::black, label.fore_color(), 0.05));
label.text(" 0.0");
timer.tick += [&] {
label.text(ustring::format("{,5:F1}", counter++ / 10.0));
};
label.mouse_down += [&] {
timer.enabled(!timer.enabled());
else {
counter = 0;
label.text(" 0.0");
}
};
application::run(form_main);
}
The xtd::drawing namespace provides access to GDI+ basic graphics functionality. More advanced functi...
Definition: bitmap.h:11
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition: system_report.h:17