Search code examples
c#winformsvisual-studio-2010tabcontrolmonthcalendar

Putting a Calendar in a customized vertical tab setting. C# - Winform


Hello so I have a customized vertical tab using the drawitem. However I can't put something in the tab control strip. I want to put a calender there so that I can utilize the free space however the tab-control doesn't let me do that. Is there a possible way of doing that thing?

*here's the image attached 1

**I want it to look like this but in a vertical format so that I can utilize the empty space in photo 1 2


Solution

  • The simplest way is to not add it to the Tab Control. Just add the control to the form, but make sure it sits on top of the Tab Control:

    Simple example:

    MonthCalendar mc1 = new MonthCalendar();
    this.Controls.Add(mc1);
    mc1.Location = new Point(0, this.ClientSize.Height - mc1.Height);
    mc1.Anchor = AnchorStyles.Left | AnchorStyles.Bottom;
    mc1.BringToFront();