Search code examples
delphiscalemonthcalendar

using ScaleBy method for TMonthCalendar


I'm using ScaleBy method to scale up/down Forms of my application at run-time. it works for almost all components but not for TMonthCalendar. Is there a way to enlarge TMonthCalendar using ScaleBy or any other method?


Solution

  • it works on;y if you disable theme. you also need to make a size change to make it work

    SetWindowTheme(MonthCalendar1.Handle, '', '');
    MonthCalendar1.ScaleBy(190, 100);
    MonthCalendar1.Width := MonthCalendar1.Width + 1;
    MonthCalendar1.Width := MonthCalendar1.Width - 1;
    

    Thanks to @Sertac for hints