Newbie here... Calendar Control

Hi everyone.

I created a Calendar Control container and placed it in a window as control, but I don’t know how to get or return the value when a certain day was pressed.

thank you

Are you aware of the DateTime picker built into Xojo? It may do what you want without an extra window?
https://documentation.xojo.com/api/user_interface/controls/datetimepicker.html#datetimepicker

Alternatively, you could add a custom event to your container. For example, DateChanged. You could raise that event any time the control changes date. To do this:

  • Add an Event Definition to your Container control. Alter it to include a parameter for the selected date.
  • Then any time the date changes (due to a number button being pressed, month or year changed, etc. Raise the event with providinging the chosen date.

You’re form can then use that event to ‘be informed’ of the chooses date.

1 Like

Thank very much @Ian_Kennedy … DateTimePicker works. thanks a lot and I will continue developing my control as well with your tips provided. learning is XOJO is fun.

you can define and raise events, also with parameters.
but i would start with DaySelected event and then provide a Methode for SelectedDate which return a DateTime object.

2 Likes