Home Forums WinForms controls Other WinForms controls WinCalendar current date panel problem

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #18177 |

    If I set the CurrentDate and the SelectedDate properties to for example to 1st of january, 2006 – then when the calendar control displayed it shows the current month’s days (october), instead of the days of january.

    Also I tried to change the text of the MonthHeader button and tried to call the PreviousButton and NextButton calls to force the WinCalendar control to display the days which belongs to the CurrentDate (or SelectedDate) values – but no success.

    How could I accomplish that? It’s a little bit confusing, and frustrates end-users, if a textbox is linked to a WinCalendar, and the textbox’s contents changed, but the WinCalendar control doesn’t reflects the changes. (In this case the user so use PrevButton, or NextButton to display that page, which contains the selected date)

    Imported from legacy forums. Posted by Szabolcs (had 2778 views)

    User (Old forums)
    Member
    Post count: 23064

    You need to set SelectedDate and FirstMonth properties when the date changes in the TextBox.

    e.g. :

    winCalendar1.FirstMonth = new DateTime( 2006, 07, 04 );
    winCalendar1.SelectedDate = new DateTime( 2006, 07, 04 );

    This will move the calendar to month of July, and set the highlighted date to the fourth.

    Imported from legacy forums. Posted by André (had 301 views)

    User (Old forums)
    Member
    Post count: 23064

    It’s working! Thank you for the prompt answer!

    Imported from legacy forums. Posted by Szabolcs (had 3763 views)

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.