Please do not post the same question more than once: delete your other version before it gets a reply! I'm not going to answer your questions directly: I don't think you are quite ready to go that far, from your questions so far. Instead, some basics which should help you to do some of it, and will set you on the right path. At present, you are using CreateGraphics to get the Graphics object for drawing, probably in a timer event, or a loop. Am I right? Don't do that. Instead, handle the Panel.Paint event. (Click on the panel in the designer, select events in the Properties pane - the lightning bolt button - and double click the Paint event). In the handler routine, you have two parameters:
void panel\_Paint(object sender, PaintEventArgs e)
{
}
The sender is the panel that need to be painted, and e is the information you need to know about how to paint it. Convert the sender to a Panel, and get the Graphics object from e:
void panel\_Paint(object sender, PaintEventArgs e)
{
Panel myPanel = sender as Panel;
if (myPanel != null)
{
Graphics g = e.Graphics;
}
}
Don't worry about the conversion code: it just means you can use the same method for more than one Panel if you need to. You can now use g to draw on the Panel, and it will not disappear. So, that solves question 3! How do you draw text? Simple:
g.DrawString("Hello", new Font("Arial",16), Brushes.Black, new Point(0,0));
How do you make the Panel draw when you want? Simple:
myPanel.Invalidate();
Call that when you have changed the information that you want to draw - the position of the text, for example. (Don't call it in the Paint handler, that won't work!) So that solves question 2! Question 1 is probably way too complex at the moment - which makes me think you have asked the wrong question! If it is still a problem, try asking in more detail about what you are trying to do.
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together. Digital man: "You are, in short, an idiot with the IQ of an ant and the intellectual capacity of a hose pipe."