tags:

views:

36

answers:

2

In Windows Form, I would like to generate a calendar (in month view), I would choose the month, and then I would like to generate an image I could save.

I know MonthCalendar control, I know how it works but I don't know how to get the image programatically. (of course, screengrabs are useless here, ;-)).

+2  A: 

What about Control.DrawToBitmap method

Orsol
+1  A: 

It is easy with the Control.DrawToBitmap() method. This worked fine:

  Bitmap bmp = new Bitmap(monthCalendar1.Width, monthCalendar1.Height);
  Rectangle rc = new Rectangle(Point.Empty, bmp.Size);
  monthCalendar1.DrawToBitmap(bmp, rc);
Hans Passant
I knew it!!!! thx!!!!
netadictos