Original Post
The program I'm writing is a Windows app using forms. On the main form there is a panel and I add all sorts of other controls to this panel such as labels, other panels, pictureboxes, etc. Then I connect the groupings using lines drawn on the main panel using the drawing functions. Everything works fine until the window is resized, minimized or the panel is scrolled. Opening other windows, moving other programs over the top of mine, etc don't seem to be an issue. But when my programs window is resized, the lines aren't redrawn from the code I'm calling from the Paint event. I've tried duplicating the paint event code into other events but the results seem to be the same. I can see the lines being drawn and then erased immediately afterwards if it's an even I can call a lot (like scrolling the panel). I've tried invalidating the panel in a number of different places in the code and they don't seem to help. Can someone point me in the direction of what else might be going on? I have a feeling there's some other event firing but I can't seem to figure out what it is.