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

demonstrates the use of xtd::forms::month_calendar control.

Windows

macOS

Gnome

#include <xtd/forms/application>
#include <xtd/forms/form>
#include <xtd/forms/label>
#include <xtd/forms/month_calendar>
#include <chrono>
using namespace std::chrono;
using namespace xtd;
using namespace xtd::forms;
class form1 : public form {
public:
form1() {
text("Month calendar example");
month_calendar1.parent(*this);
month_calendar1.location({10, 10});
month_calendar1.date_changed += [&](object&, const event_args & e) {
label1.text(string::format("selection range: [{:d}, {:d}]", month_calendar1.selection_start(), month_calendar1.selection_end()));
};
month_calendar1.selection_range({date_time::now(), date_time::now()});
month_calendar1.min_date(date_time::now().subtract(months(3)));
month_calendar1.max_date(date_time::now().add(months(3)));
label1.parent(*this);
label1.auto_size(true);
label1.location({10, 180});
label1.text(string::format("selection range: [{:d}, {:d}]", month_calendar1.selection_start(), month_calendar1.selection_end()));
}
private:
month_calendar month_calendar1;
label label1;
};
auto main() -> int {
application::run(form1 {});
}
Represents the base class for classes that contain event data, and provides a value to use for events...
Definition event_args.h:18
Represents a window or dialog box that makes up an application's user interface.
Definition form.h:54
Represents a standard Windows label.
Definition label.h:38
Represents a control that displays a month calendar.
Definition month_calendar.h:40
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