locked
Draw line rectangle circle RRS feed

  • Question

  • can anybody tell how to draw the  rectangle at runtime in windws forms using c#.net
    Thursday, December 24, 2009 9:23 AM

Answers

  • class MyControl : Control
    {
      protected override void OnPaint(PaintEventArgs pArgs)
      {
        e.Graphics.DrawRectangle(SystemPens.Control, new Rectangle(0,0, 20,20));
      }
    }



    Best regards.

    Flexible TreeView - the most flexible treeview-listview-grid hybrid control for .NET!
    • Proposed as answer by Ruslan Mogilevskiy Thursday, December 24, 2009 11:51 AM
    • Marked as answer by Jing0 Wednesday, December 30, 2009 10:10 AM
    Thursday, December 24, 2009 11:51 AM