locked
cellpaint event and spanning multiple columns. RRS feed

  • Question

  • I know how to draw within a cell of a TableLayoutPanel using the CellPaint event. However, how would I draw into a cell that would span several columns?
    Tuesday, June 12, 2012 12:41 AM

Answers

  • Current cell's graphic context will cover only the region within the cell, therefor even if you try to render larger drawings, the portion with in the region alone will be visible.

    #1. Try extending the region of the the current graphic context, before painting anything and reset it after the paint is done.

    http://msdn.microsoft.com/en-us/library/system.drawing.graphics.clip.aspx

    #2. Try painting from the parent controls context.

    The later option would be neat and appropriate.

    Hope this helps!!!

    ...


    Regards Vallarasu S. FSharpMe.blogspot.com

    • Proposed as answer by Chester Hong Tuesday, June 19, 2012 2:28 AM
    • Marked as answer by Chester Hong Friday, June 22, 2012 2:13 AM
    Tuesday, June 12, 2012 9:19 AM