No events Paint in WinForms Control

Aug 14, 2009 at 10:05 AM

I need to paint over the map. I tried to use the drawing Paint, but an event to occur.

What am I doing wrong?

Aug 14, 2009 at 11:32 AM

 

   /// <summary>
   /// custom map of GMapControl
   /// </summary>
   public class Map : GMapControl
   {
      /// <summary>
      /// any custom drawing here
      /// </summary>
      /// <param name="drawingContext"></param>
      protected override void OnPaint(PaintEventArgs e)
      {
         base.OnPaint(e);

         using(System.Drawing.Pen p = new System.Drawing.Pen(System.Drawing.Color.Blue, 2))
         {
            e.Graphics.DrawLine(p, 0, 0, 200, 200);
         }
      }
   }

 

 

Aug 14, 2009 at 11:41 AM

i'm just enabled that paint event, but still recomend use technique above to cutomize control well ;}