   (C#) Erase a line drawn on a form or panel?
  I've got a regular Windows Form with a panel on it. I'm drawing lines to connect different picture boxes (think of a flow chart or an org chart type thing). But depending on what the user does, the lines may go to different boxes at different times in the program. For example, a line may go from box A1 to box B1. Then a user selects something else and now the line from box A1 to box B1 disappears and a line is drawn from box A1 to box C1.I'm trying to figure out a way to do one of two things:A) Erase the lines I draw earlier (or make that line not redraw if I invalidate the region or something)or B) Set the Pen color to the Window color as if I selected that option from the properties Window. I would think selecting a Pen's color using Windows system colors would be a common thing, but I haven't been able to find out how to do this after an hour of searching the web and MSDN.Any ideas on how to do either of these things?   
  WOOHOO! Found an answer to my own question, and it only took me 4 hours of searching through Google. [grin] Don't really know how I missed these since I went through the System.Drawing options about a million times and the options were right there, but eh, whatever. Hopefully my blockheadedness will save someone else from doing the same thing since I see this question posted all over the net without almost no one giving an answer that makes any sense and works.So anyway, if anyone needs to draw a line on a Windows form using the system colors instead of an RGB value or one of the pre-defined brushes, use the following code: Color Background_Color = System.Drawing.SystemColors.Window;SolidBrush My_Brush = new SolidBrush(Background_Color);Pen Selected_Pen = new Pen( My_Brush, 1.0f );The following also works.  Color Background_Color = System.Drawing.Color.FromKnownColor(KnownColor.Window);SolidBrush My_Brush = new SolidBrush(Background_Color);Pen Selected_Pen = new Pen( My_Brush, 1.0f );I'm very much an amateur programmer, so I can't say which is the better method to use, but they both appear to do the same thing as far as I can tell. I guess the first way is a bit easier to read so I'm using that way.   