About Graphics. RRS feed

  • Question

  • HellO

    I am working in C#.I am drawing a rectangle and some lines on my form and some labels are also there. now i want to erase or delete (or whatever you say) only those lines which i have drawn but not the labels with a click of a button. is there any methoed to flush out desired area or lines?

    I am using Graphics class.

    Graphics g = this.CreateGraphics();

    any help would be appriciated.
    Saturday, February 16, 2008 9:10 PM


All replies

  • this.Refresh.

    Sunday, February 17, 2008 10:06 AM
  • Thanks. That helped. but can you please elaborate me about the refresh() function? how does it work? what is the client area?
    Sunday, February 17, 2008 7:12 PM
  • From the help files: 

    Refresh forces the control to invalidate its client area and immediately redraw itself and any child controls.

    The client area of a control is the bounds of the control, minus the nonclient elements such as scroll bars, borders, title bars, and menus.

    Sunday, February 17, 2008 7:43 PM