#include <xtd/forms/application>
#include <xtd/forms/form>
#include <xtd/forms/label>
#include <xtd/forms/month_calendar>
#include <chrono>
using namespace std::chrono;
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:
};
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.hpp:18
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.hpp:10